/* Sign-in pages (password, code, 2FA setup, recovery codes). Served as a file, not inline: these pages run under a
   Content-Security-Policy that allows no inline style or script (Security/AuthPageHeadersAttribute.cs). */

:root {
    --auth-teal-950: #052926;
    --auth-teal-800: #0B5F58;
    --auth-teal-700: #0E7C73;
    --auth-teal-300: #5EEAD4;
    --auth-teal-200: #99F6E4;
    --auth-ink: #18212B;
    --auth-muted: #5C6773;
    --auth-line: #D6DDE5;
    --auth-page: #F3F6F9;
    --auth-card: #FFFFFF;
    --auth-field: #FFFFFF;
    --auth-danger: #B42323;
    --auth-danger-bg: #FDECEC;
    --auth-warn: #8A5A00;
    --auth-warn-bg: #FFF4D6;
    --auth-ring: rgba(14, 124, 115, .22);
}
@media (prefers-color-scheme: dark) {
    :root {
        --auth-ink: #E6EDF3;
        --auth-muted: #9AA7B4;
        --auth-line: #2A3642;
        --auth-page: #0B1117;
        --auth-card: #121A22;
        --auth-field: #0E151C;
        --auth-danger: #FF8A8A;
        --auth-danger-bg: #2A1416;
        --auth-warn: #FFD27A;
        --auth-warn-bg: #2A2110;
        --auth-ring: rgba(94, 234, 212, .25);
    }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.auth {
    margin: 0;
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--auth-ink);
    background: var(--auth-page);
    -webkit-font-smoothing: antialiased;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .auth-shell { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }

/* ------------------------------------------------------------------ brand side */
.auth-hero { display: none; position: relative; overflow: hidden; color: #fff; isolation: isolate;
    background:
        radial-gradient(900px 520px at 8% -5%, rgba(52, 210, 193, .38), transparent 62%),
        radial-gradient(820px 520px at 105% 105%, rgba(14, 124, 115, .7), transparent 60%),
        linear-gradient(155deg, #041F1D 0%, #0A4E48 52%, #0E7C73 100%); }
@media (min-width: 1024px) { .auth-hero { display: flex; } }
.auth-hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -3; }
.auth-hero-shade { position: absolute; inset: 0; z-index: -2; }
.auth-hero.has-photo .auth-hero-shade { background: linear-gradient(155deg, rgba(4, 31, 29, .94) 0%, rgba(10, 78, 72, .82) 50%, rgba(14, 124, 115, .55) 100%); }
.auth-hero-grid { position: absolute; inset: 0; z-index: -1; opacity: .9;
    background-image: linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 35% 45%, #000 25%, transparent 78%);
    mask-image: radial-gradient(ellipse 70% 60% at 35% 45%, #000 25%, transparent 78%); }
.auth-hero-inner { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem; width: 100%; padding: 3rem clamp(2.5rem, 5vw, 4.5rem); }

.auth-brand { display: flex; align-items: center; gap: .85rem; color: inherit; text-decoration: none; }
.auth-mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 3rem; height: 3rem; border-radius: .9rem; background: #fff; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .55); }
.auth-mark img { width: 1.85rem; height: auto; display: block; }
.auth-brand strong { display: block; font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.auth-brand span { display: block; font-size: .8rem; opacity: .75; letter-spacing: .02em; }

.auth-hero-copy h1 { margin: 0 0 1rem; max-width: 30rem; font-size: clamp(1.9rem, 2.6vw, 2.6rem); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.auth-hero-copy h1 em { font-style: normal; color: var(--auth-teal-200); }
.auth-hero-copy p { margin: 0; max-width: 28rem; font-size: 1.02rem; opacity: .82; }

.auth-feed { display: grid; gap: .8rem; max-width: 27rem; margin-top: 2.25rem; }
.auth-glass { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border-radius: 1rem;
    background: rgba(255, 255, 255, .085); border: 1px solid rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 22px 44px -26px rgba(0, 0, 0, .65);
    animation: auth-rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.auth-glass:nth-child(2) { margin-left: 2.25rem; animation-delay: .12s; }
.auth-glass:nth-child(3) { margin-left: 1rem; animation-delay: .24s; }
.auth-glass-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2.4rem; height: 2.4rem; border-radius: .75rem; background: rgba(94, 234, 212, .16); color: var(--auth-teal-200); }
.auth-glass b { display: block; font-size: .9rem; font-weight: 600; }
.auth-glass small { display: block; font-size: .78rem; opacity: .72; }
.auth-glass-state { margin-left: auto; flex: none; font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; background: rgba(94, 234, 212, .18); color: var(--auth-teal-200); }
.auth-glass-state.is-live::before { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-right: .35rem; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); vertical-align: .05rem; }

.auth-trust { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin: 0; padding: 0; list-style: none; font-size: .84rem; opacity: .85; }
.auth-trust i { margin-right: .4rem; color: var(--auth-teal-200); }

@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ form side */
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; padding: 2.5rem 1.25rem; }
.auth-panel { width: 100%; max-width: 27rem; }
.auth-panel.is-wide { max-width: 30rem; }
.auth-panel-brand { display: flex; align-items: center; justify-content: center; gap: .7rem; margin-bottom: 1.75rem; color: var(--auth-ink); text-decoration: none; }
.auth-panel-brand .auth-mark { width: 2.6rem; height: 2.6rem; border-radius: .75rem; border: 1px solid var(--auth-line); box-shadow: none; }
.auth-panel-brand .auth-mark img { width: 1.55rem; }
.auth-panel-brand strong { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.auth-panel-brand span { display: block; font-size: .75rem; color: var(--auth-muted); }

.auth-card { background: var(--auth-card); border: 1px solid var(--auth-line); border-radius: 1.1rem; padding: 2.25rem 2rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 18px 40px -24px rgba(16, 24, 40, .25); }
@media (max-width: 480px) { .auth-card { padding: 1.75rem 1.25rem; border-radius: .9rem; } }

.auth-title { margin: 0 0 .35rem; font-size: 1.45rem; font-weight: 700; letter-spacing: -.015em; }
.auth-title i { color: var(--auth-teal-700); margin-right: .35rem; }
.auth-sub { margin: 0 0 1.6rem; color: var(--auth-muted); font-size: .9rem; }
.auth-sub b { color: var(--auth-ink); font-weight: 600; }
.auth-center { text-align: center; }

.auth-alert { display: flex; gap: .65rem; align-items: flex-start; margin: 0 0 1.25rem; padding: .8rem 1rem; border-radius: .7rem; font-size: .85rem; background: var(--auth-danger-bg); color: var(--auth-danger); border: 1px solid color-mix(in srgb, var(--auth-danger) 30%, transparent); }
.auth-alert i { margin-top: .2rem; }

.auth-field { margin-bottom: 1.15rem; }
.auth-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; font-size: .82rem; font-weight: 600; color: var(--auth-ink); }
.auth-control { position: relative; }
.auth-control > i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--auth-muted); font-size: .95rem; pointer-events: none; }
.auth-input { width: 100%; height: 2.9rem; padding: 0 .9rem 0 2.6rem; border: 1px solid var(--auth-line); border-radius: .7rem; background: var(--auth-field); color: var(--auth-ink); font: inherit; font-size: .95rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.auth-input::placeholder { color: color-mix(in srgb, var(--auth-muted) 75%, transparent); }
.auth-input:focus { border-color: var(--auth-teal-700); box-shadow: 0 0 0 4px var(--auth-ring); }
.auth-input.has-toggle { padding-right: 3rem; }
.auth-input.input-validation-error { border-color: var(--auth-danger); }
.auth-input.input-validation-error:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-danger) 22%, transparent); }
.auth-input.is-code { height: 3.6rem; padding: 0 1rem; text-align: center; font-size: 1.6rem; font-weight: 600; letter-spacing: .5em; text-indent: .5em; font-variant-numeric: tabular-nums; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.auth-input.is-recovery { letter-spacing: .18em; text-indent: .18em; font-size: 1.25rem; text-transform: uppercase; }
.auth-eye { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 2.3rem; height: 2.3rem; border: 0; border-radius: .55rem; background: transparent; color: var(--auth-muted); cursor: pointer; }
.auth-eye:hover { color: var(--auth-ink); background: color-mix(in srgb, var(--auth-muted) 12%, transparent); }
.auth-eye:focus-visible { outline: 2px solid var(--auth-teal-700); outline-offset: 1px; }
.auth-field-error { display: block; min-height: 0; margin-top: .35rem; font-size: .78rem; color: var(--auth-danger); }
.auth-field-error:empty { display: none; }
.auth-hint { display: flex; align-items: center; gap: .45rem; margin: .45rem 0 0; padding: .4rem .65rem; border-radius: .5rem; font-size: .78rem; background: var(--auth-warn-bg); color: var(--auth-warn); }
.auth-hint[hidden] { display: none; }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .25rem 0 1.4rem; font-size: .85rem; }
.auth-check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; color: var(--auth-ink); }
.auth-check input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--auth-teal-700); }

.auth-btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; width: 100%; height: 2.95rem; padding: 0 1.25rem; border: 0; border-radius: .7rem; font: inherit; font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer; color: #fff;
    background: linear-gradient(180deg, #11948A 0%, var(--auth-teal-700) 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 8px 18px -10px rgba(14, 124, 115, .9); transition: filter .15s, transform .05s; }
.auth-btn:hover { filter: brightness(.95); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: 3px solid var(--auth-ring); outline-offset: 2px; }
.auth-btn:disabled { cursor: progress; filter: saturate(.7); opacity: .85; }
.auth-btn.is-ghost { color: var(--auth-teal-700); background: transparent; border: 1px solid color-mix(in srgb, var(--auth-teal-700) 45%, transparent); box-shadow: none; }
@media (prefers-color-scheme: dark) { .auth-btn.is-ghost { color: var(--auth-teal-300); border-color: color-mix(in srgb, var(--auth-teal-300) 40%, transparent); } }

.auth-link { padding: 0; border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 600; color: var(--auth-teal-700); text-decoration: none; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) { .auth-link { color: var(--auth-teal-300); } }
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.auth-links form { margin: 0; }
.auth-help { margin: 1.1rem 0 0; font-size: .8rem; color: var(--auth-muted); text-align: center; }

.auth-secure { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--auth-line); font-size: .78rem; color: var(--auth-muted); }
.auth-secure i { margin-top: .15rem; color: var(--auth-teal-700); }

.auth-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1rem; font-size: .75rem; color: var(--auth-muted); }
.auth-foot i { margin-right: .3rem; color: var(--auth-teal-700); }

/* 2FA setup */
.auth-steps { margin: 0 0 1.25rem; padding: 0; list-style: none; counter-reset: step; }
.auth-steps.from-3 { counter-reset: step 2; }
.auth-steps li { position: relative; padding-left: 2.25rem; margin-bottom: .9rem; font-size: .88rem; color: var(--auth-ink); counter-increment: step; }
.auth-steps li::before { content: counter(step); position: absolute; left: 0; top: -.05rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; background: color-mix(in srgb, var(--auth-teal-700) 14%, transparent); color: var(--auth-teal-700); }
.auth-qr-wrap { display: flex; gap: 1.1rem; align-items: center; margin: .25rem 0 1.25rem; padding: 1rem; border: 1px solid var(--auth-line); border-radius: .9rem; }
.auth-qr { flex: none; width: 9.5rem; height: 9.5rem; image-rendering: pixelated; border-radius: .5rem; background: #fff; padding: .35rem; }
.auth-key-label { margin: 0 0 .4rem; font-size: .78rem; color: var(--auth-muted); }
.auth-key { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85rem; line-height: 1.6; word-break: break-word; padding: .5rem .65rem; border-radius: .5rem; border: 1px dashed var(--auth-line); background: color-mix(in srgb, var(--auth-muted) 7%, transparent); user-select: all; }
@media (max-width: 480px) { .auth-qr-wrap { flex-direction: column; align-items: stretch; } .auth-qr { margin: 0 auto; } }

/* recovery codes */
.auth-codes { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1.25rem 0; padding: 0; list-style: none; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .95rem; }
.auth-codes li { padding: .5rem; text-align: center; border-radius: .5rem; border: 1px solid var(--auth-line); background: color-mix(in srgb, var(--auth-muted) 6%, transparent); }
.auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.auth-actions .auth-btn.is-wide { grid-column: 1 / -1; }

@media (prefers-reduced-motion: reduce) { .auth-glass { animation: none; } .auth-input, .auth-btn { transition: none; } }
