/* ── The pre-session pages: sign-in (body.auth-login) and the one-card
   steps around it — password reset, the second factor (body.auth-shell).
   One stylesheet, no inline CSS, so the Content-Security-Policy can refuse
   inline styles everywhere. ── */

:root {
    color-scheme: light dark;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f6f7fb;
    color: #1f2937;
}

.card {
    width: 100%;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.error {
    background: #fef2f2;
    color: #991b1b;
    border-radius: 6px;
    font-size: 0.85rem;
    margin: 0 0 1rem;
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.notice {
    margin: 0 0 1rem;
    padding: .6rem .8rem;
    border-radius: 6px;
    background: #ecfdf5;
    color: #065f46;
    font-size: .85rem;
    text-align: left;
}

/* ── Sign-in ─────────────────────────────────────────────── */

body.auth-login .card {
    padding: 2.5rem 2.75rem;
    border-radius: 12px;
    max-width: 380px;
    text-align: center;
}

body.auth-login .card h1 {
    margin: 0 0 0.4rem;
    font-size: 1.4rem;
}

body.auth-login .card .logo {
    margin: 0 auto 1rem;
    line-height: 0;
}

body.auth-login .card .logo svg {
    display: block;
    width: auto;
    height: 110px;
    max-width: 100%;
    margin: 0 auto;
}

body.auth-login .card p.lead {
    margin: 0 0 1.6rem;
    color: #6b7280;
    font-size: 0.95rem;
}

body.auth-login .error {
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1.2rem;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 0.7rem 1.2rem;
    background: #fff;
    color: #1f2937;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: box-shadow 0.15s, border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.google-btn:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-color: #9ca3af;
}

.google-btn svg {
    width: 18px;
    height: 18px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #9ca3af;
    font-size: 0.8rem;
    margin: 1.4rem 0 1.1rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.divider span {
    padding: 0 0.7rem;
}

.pw-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
}

.pw-form input {
    padding: 0.65rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    width: 100%;
}

.pw-form input:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.pw-btn {
    padding: 0.7rem 1.2rem;
    background: #1f2937;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
}

.pw-btn:hover {
    background: #111827;
}

.pw-help {
    margin: .9rem 0 0;
    font-size: .8rem;
}

.pw-help a {
    color: #6b7280;
    text-decoration: underline;
}

.footer {
    margin-top: 1.6rem;
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.02em;
    color: #9ca3af;
}

/* ── The one-card steps (password reset, second factor) ──── */

body.auth-shell {
    color: #111827;
}

body.auth-shell .card {
    max-width: 420px;
    margin: 1rem;
    padding: 2rem 2.2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, .08);
}

body.auth-shell h1 {
    margin: 0 0 .6rem;
    font-size: 1.25rem;
}

body.auth-shell p {
    line-height: 1.5;
    font-size: .92rem;
}

body.auth-shell .muted {
    color: #6b7280;
    font-size: .82rem;
}

body.auth-shell ul.problems {
    margin: 0 0 1rem 1.1rem;
    padding: 0;
    color: #991b1b;
    font-size: .85rem;
}

body.auth-shell form {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-top: .8rem;
}

body.auth-shell label {
    font-size: .82rem;
    color: #374151;
}

body.auth-shell input {
    padding: .6rem .7rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .95rem;
}

body.auth-shell input.code {
    font-size: 1.35rem;
    letter-spacing: .25em;
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

body.auth-shell button {
    padding: .65rem;
    border: 0;
    border-radius: 6px;
    background: #1f2937;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

body.auth-shell button:hover {
    background: #111827;
}

body.auth-shell .secret {
    display: block;
    margin: .6rem 0;
    padding: .7rem;
    border-radius: 6px;
    background: #f3f4f6;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.05rem;
    letter-spacing: .08em;
    word-break: break-all;
}

body.auth-shell .codes {
    columns: 2;
    margin: .6rem 0;
    padding: 0;
    list-style: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

body.auth-shell .back {
    margin: 1.2rem 0 0;
    font-size: .82rem;
}

body.auth-shell .back a,
body.auth-shell .muted a {
    color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    body.auth-shell {
        background: #0e1a2b;
        color: #f9f5ee;
    }

    body.auth-shell .card {
        background: #14243a;
        box-shadow: none;
        border: 1px solid rgba(255, 255, 255, .08);
    }

    body.auth-shell input {
        background: #0e1a2b;
        color: #f9f5ee;
        border-color: #334155;
    }

    body.auth-shell .secret {
        background: #0e1a2b;
    }

    body.auth-shell label,
    body.auth-shell .muted,
    body.auth-shell .back a {
        color: #cbd5e1;
    }
}

/* The square brand mark inlined on the sign-in page: its fills, which the
   SVG file carries in a <style> block the page strips (inline style is
   refused by the Content-Security-Policy). */
body.auth-login .logo .st0 {
    fill: #462F00;
}

body.auth-login .logo .st1 {
    fill: #FF6D0A;
}

body.auth-login .logo .st2 {
    fill: #E8590A;
}
