/* ============================================================================
   startpage.css — Stylesheet der Standalone-Startseite (index.html)
   (Phase 4, Inline-Styles Scheibe 3)

   Strikt werterhaltender Umzug des frueheren Inline-<style>-Blocks aus
   core/templates/index.html (Landing-/Login-Seite, Route "/"). Die Seite ist
   STANDALONE (erbt nicht von base.html) und ist der EINZIGE Konsument dieser
   Datei -> Klassen bewusst flach/ungescoped (.startseite, .modal, .btn, ...);
   NICHT auf anderen Seiten einbinden, die Namen sind generisch.

   Hintergrundbild: im Template hing das background-image an einem
   {% static %}-Tag (img/archiv.jpg) -- hier stattdessen als RELATIVE URL;
   der Manifest-Storage (Whitenoise) schreibt sie beim collectstatic auf den
   gehashten Dateinamen um. Das JS-Preload im Template ({% static %}) ergibt
   dieselbe URL -> ein Request, Cache-Hit.
   ACHTUNG: Der Manifest-Rewriter matcht "url("-Muster AUCH IN KOMMENTAREN --
   deshalb hier nirgends eine solche Sequenz woertlich zitieren.

   Tokenisierung nur wert-exakt + rollenkonform (Muster ADR-0012, wie auth.css):
   #4f80ff -> var(--ds-color-accent) (.loading-spinner, .btn, input:focus),
   #3a6cd9 -> var(--ds-color-accent-hover) (.btn:hover). Status-Farben waren
   schon tokenisiert (--ds-error-*, --ds-success-* usw.).
   Seit ADR-0021 sind auch die Neutralen wert-exakt tokenisiert: #fff ->
   --ds-bg-surface, #f3f3f3 -> --ds-gray-100, #999 -> --ds-text-muted,
   #333 -> --ds-text, #444 -> --ds-gray-800, #ddd -> --ds-border-strong.
   Bewusst literal bleiben: alle rgba()-Schatten/Overlays sowie Werte, die im
   Bestand nur ein-/zweimal vorkommen (keine Token-Stufe).

   Django-Messages (T13, ADR-0020): erledigt. Hier standen bis 07/2026 eigene
   .messages/.message-Regeln (in-flow, border-left, slideDown) als bewusst
   abweichende Schwester-Variante zu base.css. Sie sind entfallen -- die
   Startseite laedt jetzt core/css/messages.css und zeigt dieselben Toasts wie
   alle anderen Seiten.
   System-Message-BASIS kommt aus core/css/system_messages.css (ADR-0015);
   hier liegt nur der Seiten-Override (schmal + zentriert).
   ============================================================================ */

@font-face {
    font-family: 'DINNextLTPro';
    font-display: swap;
    src: url('https://assets.rndtech.de/one/fonts/DINNextLTPro/DINNextLTPro-Bold.ttf') format('truetype');
    font-weight: bold;
}

@font-face {
    font-family: 'DINNextLTPro';
    font-display: swap;
    src: url('https://assets.rndtech.de/one/fonts/DINNextLTPro/DINNextLTPro-Regular.ttf') format('truetype');
    font-weight: normal;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'DINNextLTPro', Arial, sans-serif;
}
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ds-bg-surface);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}
.loading.fade-out {
    opacity: 0;
    pointer-events: none;
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--ds-gray-100);
    border-top: 5px solid var(--ds-color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.startseite {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-image: url("../../img/archiv.499c8c1cca67.jpg");
    background-size: cover;
    background-position: center;
    padding-top: 100px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}
.startseite.loaded {
    opacity: 1;
}
.header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    padding: 30px 50px;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
}
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    filter: blur(10px);
    margin: -20px;
    z-index: 1;
}
.logo {
    width: 80px;
    height: auto;
    margin-right: 20px;
    position: relative;
    z-index: 2;
}
.slogan {
    font-family: 'DINNextLTPro', Arial, sans-serif;
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
}
.buttons {
    display: flex;
    gap: 20px;
    position: relative;
    z-index: 2;
}
.btn {
    padding: 12px 30px;
    font-size: 1.1em;
    border: none;
    cursor: pointer;
    background-color: var(--ds-color-accent);
    color: white;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.btn:hover {
    background-color: var(--ds-color-accent-hover);
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
}
.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: slideIn 0.3s;
}
@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--ds-text-muted);
    transition: color 0.3s;
    line-height: 1;
    height: 24px;
    width: 24px;
    text-align: center;
}
.modal-close:hover {
    color: var(--ds-text);
}
.modal-title {
    font-size: 1.8em;
    margin-bottom: 20px;
    text-align: center;
    color: var(--ds-text);
    font-weight: bold;
}
.modal form {
    width: 100%;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--ds-gray-800);
}
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--ds-border-strong);
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s;
}
.form-group input:focus {
    border-color: var(--ds-color-accent);
    outline: none;
}
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}
.checkbox-group input {
    margin-right: 8px;
}

/* Die vier letzten statischen style="..."-Attribute aus index.html
   (T3-Follow-up, 04.08.2026). Werterhaltend gehoben, eine Klasse je Attribut;
   #4f80ff -> var(--ds-color-accent) ist wert-exakt (tokens.css) und die Datei
   ist im Head von index.html VOR dieser geladen (Bedingung aus ADR-0018).

   .checkbox-group.is-tight und .btn.is-full sind bewusst DOPPELKLASSEN: ein
   Inline-Style schlaegt jede Klasse, seine Wirkung erbt nur ein Selektor, der
   die Basisklasse ueberbietet (.checkbox-group setzt margin-bottom: 20px,
   .btn keine Breite). Muster wie das Logout-style= in T3 Scheibe 4. */
.checkbox-group.is-tight {
    margin-top: 8px;
    margin-bottom: 0;
}
.forgot-row {
    text-align: right;
    margin-top: 8px;
}
.forgot-link {
    font-size: 0.9em;
    color: var(--ds-color-accent);
    text-decoration: none;
}
.btn.is-full {
    width: 100%;
}

/* SSO-Anmeldung (ADR-0040). Zwei Zusaetze, bewusst getrennt gehalten:

   a.btn -- das Element ist ein LINK, kein <button>. Der SSO-Weg beginnt mit
   einem GET auf /oidc/authenticate/; ein <button> braeuchte dafuer ein zweites
   <form> im Login-Formular, und verschachtelte Formulare sind nicht erlaubt.
   Ein <a> erbt aber weder Zentrierung noch Box-Modell eines Buttons -- ohne
   diese Regel steht der Text links und `width: 100%` wirkt gar nicht
   (ein <a> ist inline).

   .btn.is-secondary -- DOPPELKLASSE aus demselben Grund wie .btn.is-full
   darueber: .btn setzt background-color und color selbst, ein einfacher
   .is-secondary-Selektor haette dieselbe Spezifitaet und seine Wirkung haenge
   an der Reihenfolge in der Datei. Rollen-Token statt Skalen-Token (ADR-0021). */
a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    box-sizing: border-box;
    text-decoration: none;
    text-align: center;
}
.btn.is-secondary {
    background-color: var(--ds-bg-muted);
    color: var(--ds-text);
    border: 1px solid var(--ds-border);
}
.btn.is-secondary:hover {
    background-color: var(--ds-bg-surface);
}
.sso-trenner {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    margin: 18px 0 12px;
    color: var(--ds-text-muted);
    font-size: 0.85em;
}
.sso-trenner::before,
.sso-trenner::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--ds-border);
}

.error-message {
    color: var(--ds-error-text);
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--ds-error-bg);
    border-radius: 4px;
    font-size: 0.9em;
}

/* Django-Messages: die frueher hier stehende in-flow-Variante (.messages,
   border-left 4px, slideDown) ist mit T13 (ADR-0020) entfallen. Die Startseite
   nutzt jetzt dieselbe Toast-Darstellung wie alle anderen Seiten, geladen aus
   core/css/messages.css (im Head von index.html VOR dieser Datei). Der
   @keyframes slideDown hatte keinen weiteren Konsumenten und ist mit
   entfallen; die Modal-Animationen fadeIn/slideIn bleiben unberuehrt (sie
   kollidieren nicht mehr, weil die Message-Keyframes ds-message-in/-out
   heissen). NICHT hier wieder .message-Regeln einfuehren -- ein Owner. */

/* System-Messages: Basis kommt aus core/css/system_messages.css (ADR-0015);
   Seiten-Override: schmal + zentriert auf der Startseite */
.system-message {
    width: 90%;
    max-width: 600px;
}

/* ============================================================================
   T9 Scheibe 3: der Standalone-Header der Startseite auf schmalen Schirmen

   Befund, gemessen am 05.08.2026 (t9s3_befund.js) -- und er widerlegt die
   Vermutung aus der T9-Kartierung ("negativer linker Rand"):

     .startseite  ist display:flex, flex-direction:column, ALIGN-ITEMS:CENTER
     .header      ist deshalb fit-content statt volle Breite, box-sizing ist
                  content-box:   Logo 80 + margin 20 + Slogan 221,8 = 321,8
                  + padding 2x50                                    = 421,8 px

   In einem 390 px breiten Container ragt er dadurch SYMMETRISCH heraus --
   x = -16 links und +16 rechts. Es ist also keine Randvorgabe, sondern eine
   Mindestbreite des Inhalts; ein Rand-Fix haette daran nichts geaendert.
   Bei 320 px sind es entsprechend 51 px.

   Korrektur: der Header nimmt die volle Zeilenbreite (width: 100% schlaegt
   das fit-content aus align-items: center), das Padding wandert per
   border-box nach INNEN, und .startseite bekommt einen seitlichen Rand,
   damit der Kasten nicht am Bildschirmrand klebt. Der Slogan bricht dann um,
   statt die Seite aufzuschieben.

   Der Desktop bleibt unberuehrt: alles steht in einer Media-Query, die
   oberhalb 768 px nicht gilt (im Browser gegengeprueft, nicht nur behauptet).
   ============================================================================ */

@media (max-width: 768px) {
    .startseite {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header {
        width: 100%;
        box-sizing: border-box;
        padding: 20px 16px;
    }

    /* Ohne das Folgende waere der Schritt auf sehr schmalen Geraeten eine
       VERSCHLECHTERUNG, und das ist gemessen, nicht befuerchtet: bei 320 px
       stehen dem Slogan 188 px zur Verfuegung, seine min-content-Breite ist
       aber 221,8 px ("RND-Grafik-Bibliothek!" ist ein Wort ohne
       Umbruchgelegenheit). Ein Flex-Item schrumpft nicht unter min-content
       (min-width: auto) -- der Text lief also weiter ueber und wurde vom
       overflow: hidden des Headers ABGESCHNITTEN. Vorher war er wenigstens
       durch Scrollen erreichbar.
       min-width: 0 hebt die Schrumpfsperre auf, overflow-wrap erlaubt den
       Umbruch innerhalb des langen Wortes. */
    .slogan {
        min-width: 0;
        overflow-wrap: break-word;
    }
}
