/*
    Anmelde- und Einrichtungsstrecke (Views/Shared/_Layout_Auth.cshtml):
    Ersteinrichtung, Postfach-Hinweis, E-Mail-Bestätigung.

    Eine ruhige Glaskarte auf dem App-Hintergrund (html.ds-page body::before) — dieselbe
    Anmutung wie die Oberfläche dahinter, damit der erste Bildschirm einer neuen Installation
    nicht nach Gerüst aussieht. Alle Farben aus den Design-Tokens, deshalb trägt das Layout
    hell und dunkel automatisch.
*/

.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    background: transparent; /* sonst überdeckt der Body den fixierten ds-page-Hintergrund */
    color: var(--ds-foreground);
    /* Die Hausschrift hängt in design-system.css an .ds-main/.ds-sidebar, also am App-Layout.
       Ohne diese Zeile fiele die Anmeldestrecke auf die Browser-Serifenschrift zurück. */
    font-family: 'Geist', Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-wrap {
    box-sizing: border-box;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem 1rem 1.25rem;
}

.auth-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 27rem;
    padding: 2rem 1.75rem;
    border: 1px solid var(--ds-border);
    border-radius: 1.25rem;
    background: color-mix(in srgb, var(--ds-card, var(--ds-surface)) 90%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 24px 60px -22px rgba(0, 0, 0, .5);
}

/* Zwei Namensfelder nebeneinander brauchen etwas mehr Luft. */
.auth-card-wide { max-width: 32rem; }

@media (max-width: 575.98px) {
    .auth-wrap { padding: 1.25rem .75rem 1rem; justify-content: flex-start; }
    .auth-card { padding: 1.5rem 1.15rem; border-radius: 1rem; }
}

/* ---- Kopf ---------------------------------------------------------------- */

.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Höhe großzügig: kompakte Bildmarken (Seitenverhältnis ~2:1) stießen bei 72 px an die Decke
   und ihre Unterzeile wurde unlesbar; breite Wortmarken begrenzt weiterhin die Breite. */
.auth-brand img {
    max-width: 240px;
    max-height: 110px;
    object-fit: contain;
}

/* Liegen beide Wortmarken vor, zeigt jedes Design seine — eine dunkle Wortmarke auf der
   dunklen Karte wäre sonst unlesbar. Liegt nur eine, trägt sie keine dieser Klassen. */
.auth-logo-hell { display: none; }

html.ds-page.dark .auth-logo-dunkel { display: none; }
html.ds-page.dark .auth-logo-hell { display: inline-block; }

@media (prefers-color-scheme: dark) {
    html.ds-page:not(.light) .auth-logo-dunkel { display: none; }
    html.ds-page:not(.light) .auth-logo-hell { display: inline-block; }
}

.auth-title {
    margin: 0 0 .4rem;
    text-align: center;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.auth-sub {
    margin: 0 0 1.5rem;
    text-align: center;
    font-size: .875rem;
    line-height: 1.55;
    color: var(--ds-muted-foreground);
}

/* Statusbild der Meldeseiten (Postfach prüfen, bestätigt, fehlgeschlagen). */
.auth-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 2rem;
    background: color-mix(in srgb, var(--ds-accent-1) 14%, transparent);
    color: var(--ds-accent-1);
}

.auth-icon-success {
    background: color-mix(in srgb, var(--ds-success) 14%, transparent);
    color: var(--ds-success);
}

.auth-icon-error {
    background: color-mix(in srgb, var(--ds-destructive) 14%, transparent);
    color: var(--ds-destructive);
}

/* ---- Formular ------------------------------------------------------------ */

.auth-alert {
    margin-bottom: 1.25rem;
    text-align: left;
}

/* asp-validation-summary rendert eine <ul> — die soll im Alert nicht ausbrechen. */
.auth-alert ul {
    margin: 0;
    padding-left: 1.1rem;
}

.auth-field { margin-bottom: 1rem; }

.auth-field .control-label {
    display: block;
    margin-bottom: .35rem;
    font-size: .8125rem;
    font-weight: 600;
}

/* Nur der Fehlertext unter dem Feld — NICHT das Pflicht-Sternchen im Label, das ebenfalls
   .text-danger trägt und sonst auf eine eigene Zeile rutscht. */
.auth-field > span.text-danger {
    display: block;
    margin-top: .3rem;
    font-size: .78rem;
}

.auth-field > span.text-danger:empty { display: none; }

.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

@media (max-width: 430px) {
    .auth-row { grid-template-columns: 1fr; gap: 0; }
}

/* Passwort-Regeln, die beim Tippen abhaken — ohne sie rät man beim ersten Konto,
   woran Identity die Eingabe abgelehnt hat. */
.auth-rules {
    list-style: none;
    margin: .5rem 0 0;
    padding: 0;
    display: grid;
    gap: .2rem;
    font-size: .78rem;
    color: var(--ds-muted-foreground);
}

.auth-rules li {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.auth-rules li i { font-size: .85rem; opacity: .55; }

.auth-rules li.is-ok { color: var(--ds-success); }
.auth-rules li.is-ok i { opacity: 1; }

.auth-actions { margin-top: 1.5rem; }

.auth-actions .ds-btn {
    width: 100%;
    justify-content: center;
}

.auth-links {
    margin-top: 1.25rem;
    text-align: center;
    font-size: .85rem;
}

.auth-links a { color: var(--ds-accent-1); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* Ersatz-Aktivierungslink, wenn der Mailversand der frischen Installation scheitert. */
.auth-linkbox {
    margin-top: .6rem;
    padding: .6rem .7rem;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    background: var(--ds-muted);
    font-size: .75rem;
    line-height: 1.5;
    word-break: break-all;
}

.auth-mail-wrap { text-align: center; }

.auth-mail {
    display: inline-block;
    margin: 0 0 1.25rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: var(--ds-muted);
    font-size: .85rem;
    font-weight: 600;
}

/* ---- Fuß ----------------------------------------------------------------- */

.auth-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-size: .78rem;
    color: var(--ds-muted-foreground);
}

.auth-foot a { color: inherit; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
