@import url("hochkant.css");
/* auth.css – Anmelden, Registrieren, Passwort vergessen, E-Mail bestätigen (Entwurf H):
   blauer Bogen oben mit Logo, darunter eine weiße Karte. Eine Datei für alle vier Seiten. */
@font-face { font-family: Manrope; src: url("/assets/fonts/Manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }

:root {
    --a-bg: #f2f4f7;
    --a-card: #ffffff;
    --a-text: #16202b;
    --a-muted: #5b6774;
    --a-line: #dfe4ea;
    --a-field: #f5f7fa;
    --a-blue: #005a9c;
    --a-blue-text: #005a9c;
    --a-err-bg: #fdecea;
    --a-err: #b42318;
    --a-ok-bg: #e7f5ec;
    --a-ok: #1f7a4d;
}
@media (prefers-color-scheme: dark) {
    :root {
        --a-bg: #0f141a;
        --a-card: #1b232d;
        --a-text: #e8edf3;
        --a-muted: #9aa7b5;
        --a-line: #34404e;
        --a-field: #131a22;
        --a-blue: #0b6bb5;
        --a-blue-text: #6fb6ff;
        --a-err-bg: #3a1a17;
        --a-err: #ff9b8f;
        --a-ok-bg: #12301f;
        --a-ok: #7fd3a2;
    }
}

/* iPhone: Gescrollt wird in body statt in der ganzen Seite, darin liegt .auth-page (hell, deckend).
   Beim Nachfedern schaut body hervor: oben blau, unten hell. html bleibt blau für die Leiste oben (Uhrzeit). */
html { height: 100%; overflow: hidden; background: var(--a-blue); overscroll-behavior: none; }
body {
    margin: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* iOS 26 färbt die Leiste oben (Uhrzeit) mit der Hintergrundfarbe von body: die ist blau */
    background: linear-gradient(var(--a-blue) 50%, var(--a-bg) 50%), var(--a-blue);
    color: var(--a-text);
    font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.auth-page {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--a-bg);
    overflow: clip;
    position: relative;
}
.auth-brand {
    position: relative;
    z-index: 1;
    margin-top: auto;
    text-align: center;
    padding: calc(env(safe-area-inset-top, 0px) + 2.5rem) 1rem 1.6rem;
    color: #fff;
}
/* Blauer Bogen hinter dem Logo: wandert mit, wenn alles mittig steht */
.auth-brand::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -120px;
    width: max(1100px, 170vw);
    height: 1400px;
    transform: translateX(-50%);
    border-radius: 0 0 50% 50% / 0 0 410px 410px;
    background: var(--a-blue);
    z-index: -1;
}
.auth-brand img { height: 2.6rem; width: auto; max-width: 80vw; display: block; margin: 0 auto; }
.auth-brand p { margin: 0.6rem 0 0; color: #cfe0ef; font-size: 0.95rem; }

.login-container,
.register-container,
.reset-container,
.verify-container {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: calc(100% - 2rem);
    max-width: 420px;
    margin: 0 1rem auto;
    padding: 1.6rem 1.4rem;
    background: var(--a-card);
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(20, 30, 50, 0.12);
    overflow-wrap: break-word;
}
.register-container { max-width: 440px; }
/* Etwas Luft nach unten, damit es optisch mittig wirkt und nie am Rand klebt */
.auth-page::after { content: ""; flex: none; height: 2rem; }
.verify-container { text-align: center; }

.login-header, .register-header, .reset-header { text-align: center; margin-bottom: 1.25rem; }
.login-header h1, .register-header h1, .reset-header h1 { display: none; }
.login-header p, .register-header p, .reset-header p { margin: 0; color: var(--a-text); font-size: 1.25rem; font-weight: 800; }
.verify-container h2 { margin: 0 0 0.75rem; color: var(--a-text); font-size: 1.25rem; font-weight: 800; }

.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; color: var(--a-muted); font-size: 0.85rem; font-weight: 700; }
.form-group input,
.code-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 1rem;
    border: 1px solid var(--a-line);
    border-radius: 12px;
    background: var(--a-field);
    color: var(--a-text);
    font: inherit;
    font-size: 1rem;
}
.form-group input:focus,
.code-input:focus { outline: none; border-color: var(--a-blue-text); box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.15); }
.form-group small,
.password-requirements { display: block; margin-top: 0.3rem; color: var(--a-muted); font-size: 0.8rem; line-height: 1.4; }
.form-group.invite-group { padding: 0.9rem; border: 1px dashed var(--a-blue-text); border-radius: 14px; }
.form-group.invite-group label { color: var(--a-blue-text); }
.form-group.invite-group input { text-align: center; text-transform: uppercase; letter-spacing: 2px; font-weight: 700; font-size: 1.1rem; }

.code-input { font-size: 1.75rem; font-family: SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.4em; text-align: center; padding-left: 0.9rem; }

/* Hauptknopf */
.btn-login,
.btn-register,
.btn-submit,
.passkey-first .btn-passkey {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    min-height: 50px;
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--a-blue);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}
.btn-login:disabled,
.btn-register:disabled,
.btn-submit:disabled,
.btn-passkey:disabled { opacity: 0.6; cursor: not-allowed; }

/* Zweiter Knopf (Passkey, wenn noch nicht Hauptweg) */
.btn-passkey {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 48px;
    padding: 0.8rem 1rem;
    border: 1px solid var(--a-line);
    border-radius: 999px;
    background: var(--a-card);
    color: var(--a-blue-text);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.btn-passkey svg { flex-shrink: 0; }
.passkey-first .passkey-login { margin-bottom: 0.5rem; }
.passkey-first .passkey-divider { display: none; }
.btn-password-toggle { width: 100%; min-height: 44px; margin-top: 0.5rem; border: 0; background: none; color: var(--a-blue-text); font: inherit; font-weight: 700; cursor: pointer; }

.passkey-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.1rem 0 0.9rem; color: var(--a-muted); font-size: 0.85rem; }
.passkey-divider::before,
.passkey-divider::after { content: ""; flex: 1; height: 1px; background: var(--a-line); }

.error-message,
.success-message { display: none; margin-bottom: 1rem; padding: 0.8rem 0.9rem; border-radius: 12px; font-size: 0.9rem; text-align: left; }
.error-message { background: var(--a-err-bg); color: var(--a-err); }
.success-message { background: var(--a-ok-bg); color: var(--a-ok); }
.success-message a { color: inherit; font-weight: 700; }
.setup-info { margin-bottom: 1.25rem; padding: 0.9rem; border-radius: 12px; background: var(--a-field); color: var(--a-text); font-size: 0.9rem; line-height: 1.5; }

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 3rem !important; }
.password-toggle { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); display: flex; align-items: center; padding: 0.25rem; border: 0; background: none; color: var(--a-muted); line-height: 1; cursor: pointer; }
.password-toggle .eye-closed { display: none; }
.password-toggle.active .eye-open { display: none; }
.password-toggle.active .eye-closed { display: block; }

.auth-links, .verify-links { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.9rem; }
.auth-links a, .verify-links a, .link-button, .login-link a { color: var(--a-blue-text); font-weight: 700; text-decoration: none; }
.link-button { min-height: 44px; display: inline-flex; align-items: center; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.link-button:disabled { color: var(--a-muted); cursor: default; }
.verify-links a { min-height: 44px; display: inline-flex; align-items: center; }
.login-link { margin-top: 1.25rem; text-align: center; color: var(--a-muted); font-size: 0.9rem; }

/* "Registrieren" als eigener Knopf unter dem Formular */
.register-link { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--a-line); text-align: center; color: var(--a-muted); font-size: 0.9rem; }
.register-link a { display: flex; align-items: center; justify-content: center; min-height: 46px; margin-top: 0.5rem; border: 1px solid var(--a-line); border-radius: 999px; color: var(--a-blue-text); font-weight: 800; text-decoration: none; }

.verify-intro { margin: 0 0 1.25rem; color: var(--a-muted); font-size: 0.95rem; line-height: 1.5; }
.verify-message { margin-bottom: 1.5rem; color: var(--a-text); font-size: 1.05rem; line-height: 1.5; }
.verify-message.error { color: var(--a-err); }
.verify-message.success { color: var(--a-ok); }

.form-container { display: block; }
.form-container.hidden, .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Datenauskunft: Hinweis unter dem Knopf, danach "Datei sichern" (M-r4) */
.da-status { margin: 0.9rem 0 0; color: var(--a-muted); font-size: 0.95rem; }

/* Impressum und Datenschutz (D-r2): längerer Text, gleiche Karte wie Anmelden */
.reset-container.legal-container { max-width: 680px; }
.legal-text { padding: 0; color: var(--a-text); line-height: 1.6; overflow-wrap: anywhere; }
.legal-text h2 { margin: 1.4rem 0 0.4rem; font-size: 1.05rem; }
.legal-text p, .legal-text ul { margin: 0 0 0.8rem; }
.legal-text ul { padding-left: 1.2rem; }
.legal-text li { margin-bottom: 0.5rem; }
.legal-text a { color: var(--a-blue-text); font-weight: 700; }
.legal-missing { color: var(--a-err); font-weight: 700; }
.legal-stand { color: var(--a-muted); font-size: 0.9rem; }
.auth-legal { position: relative; z-index: 1; margin: 1.2rem auto 2rem; text-align: center; font-size: 0.9rem; color: var(--a-muted); }
.auth-legal a { color: inherit; font-weight: 700; text-decoration: none; }
.reg-legal-hint { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--a-muted); }
.reg-legal-hint a { color: var(--a-blue-text); font-weight: 700; }
.reset-intro { margin-top: 0; color: var(--a-muted); font-size: 0.9rem; }

/* hidden gilt auch für Knöpfe mit display:flex */
[hidden] { display: none !important; }

/* Zweiter Schritt der Anmeldung für Admins (Zwei-Faktor) */
.totp-hint { margin: 0 0 1.1rem; line-height: 1.45; }
