/* Forgot / reset / change password pages (templates/registration/auth_base.html). Same card and palette as the
   sign-in page: navy, sky #34B8F6, action blue #0A74B8, 8px spacing. Loaded as a file, never inline: these pages
   are served with portal.middleware.STRICT_CSP (no 'unsafe-inline'). */
@font-face { font-family: 'DM Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url("../branding/fonts/dm-sans-latin-400-normal.woff2") format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url("../branding/fonts/dm-sans-latin-500-normal.woff2") format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url("../branding/fonts/dm-sans-latin-600-normal.woff2") format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 800; font-style: normal; font-display: swap; src: url("../branding/fonts/archivo-latin-800-normal.woff2") format('woff2'); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.auth { min-height: 100vh; display: flex; flex-direction: column; font: 400 15px/1.5 'DM Sans', system-ui, sans-serif; color: #F1F5F9;
    background: #0B1322 radial-gradient(1200px 600px at 70% -10%, #1B2D4F 0%, #0F1A2E 55%, #0B1322 100%) fixed; }

.skip-link { position: absolute; left: 16px; top: -48px; padding: 8px 12px; background: #0A74B8; color: #fff; border-radius: 6px; z-index: 10; }
.skip-link:focus { top: 16px; }

.auth-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 440px; background: #111B2E; border: 1px solid #22324F; border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,.45); overflow: hidden; }

.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 24px 24px;
    background: #0F1A2E; border-bottom: 2px solid #34B8F6; }
.auth-brand img { height: 112px; width: auto; display: block; }
.auth-brand span { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #34B8F6; }

.auth-body { padding: 32px 40px 40px; }
.auth-head { text-align: center; margin-bottom: 32px; }
.auth-head h1 { font-family: "Archivo", "DM Sans", system-ui, sans-serif; font-weight: 800; font-size: 26px; line-height: 1.2;
    letter-spacing: -.01em; color: #F8FAFC; margin: 0 0 8px; }
.auth-head p { font-size: 15px; color: #94A3B8; margin: 0; }
.auth-head .auth-icon { width: 48px; height: 48px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(52,184,246,.12); color: #34B8F6; }
.auth-head .auth-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-head .auth-icon.is-warn { background: rgba(248,113,113,.12); color: #FCA5A5; }

.auth-text { font-size: 15px; color: #CBD5E1; text-align: center; margin: 0 0 16px; }
.auth-text strong { color: #F8FAFC; }
.auth-note { font-size: 14px; color: #94A3B8; text-align: center; margin: 16px 0 0; }
.auth-note a, .auth-text a { color: #34B8F6; }

.auth-error { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; padding: 12px 16px; border-radius: 8px;
    background: #2E1416; border: 1px solid #6E2A2E; color: #FCA5A5; font-size: 14px; font-weight: 500; line-height: 1.45; }
.auth-error svg { flex: none; width: 20px; height: 20px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.auth-error p { margin: 0; }

.auth-form .field { margin-bottom: 16px; }
.auth-form .field label { display: block; font-size: 14px; font-weight: 600; color: #CBD5E1; margin-bottom: 8px; }
.auth-form .field input { width: 100%; height: 44px; padding: 0 14px; font: 400 16px 'DM Sans', system-ui, sans-serif; background: #0B1322;
    border: 1px solid #2C3B56; border-radius: 8px; color: #F1F5F9; }
.auth-form .field input:hover { border-color: #475569; }
.auth-form .field input:focus { outline: none; border-color: #34B8F6; box-shadow: 0 0 0 3px rgba(52,184,246,.25); }
.auth-form .field input[aria-invalid="true"] { border-color: #F87171; }
.field-hint { margin: 8px 0 0; font-size: 13px; color: #94A3B8; }
.field-error { margin: 8px 0 0; font-size: 13px; font-weight: 500; color: #FCA5A5; }

.pw-wrap { position: relative; }
.auth-form .pw-wrap input { padding-right: 48px; }
.pw-toggle { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 6px; background: transparent; color: #94A3B8; cursor: pointer; }
.pw-toggle:hover { color: #F1F5F9; background: rgba(255,255,255,.06); }
.pw-toggle:focus-visible { outline: 2px solid #34B8F6; outline-offset: 0; }
.pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pw-toggle .eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .eye { display: none; }
.pw-toggle[aria-pressed="true"] .eye-off { display: block; }
.no-js .pw-toggle { display: none; }

.btn-auth { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; margin-top: 8px; background: #0A74B8; color: #fff;
    border: 0; border-radius: 8px; font: 600 16px "DM Sans", system-ui, sans-serif; text-decoration: none; cursor: pointer;
    box-shadow: 0 4px 16px rgba(10,116,184,.3); transition: background .15s, transform .15s; }
.btn-auth:hover { background: #0B85D2; transform: translateY(-1px); }
.btn-auth:active { transform: none; }
.btn-auth:focus-visible { outline: 2px solid #34B8F6; outline-offset: 3px; }

.auth-foot { text-align: center; margin-top: 16px; }
.auth-foot a { font-size: 14px; font-weight: 500; color: #34B8F6; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
.auth-foot a:focus-visible { outline: 2px solid #34B8F6; outline-offset: 2px; border-radius: 4px; }

.auth-help { margin-top: 24px; font-size: 14px; color: #94A3B8; text-align: center; }
.auth-help a { color: #34B8F6; }

.auth-footer { padding: 16px; text-align: center; font-size: 12px; color: #64748B; border-top: 1px solid rgba(255,255,255,.06); }

@media (max-width: 520px) {
    .auth-wrap { padding: 32px 16px; }
    .auth-brand img { height: 88px; }
    .auth-body { padding: 24px 24px 32px; }
    .auth-head h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .btn-auth { transition: none; } }

/* Two-step sign-in (Train 2FA) */
.auth-steps { margin: 0 0 24px; padding-left: 20px; color: #CBD5E1; font-size: 14px; line-height: 1.6; }
.auth-steps li { margin-bottom: 8px; }
.auth-steps strong { color: #F8FAFC; }
.auth-key { margin: 8px 0 0; padding: 12px; background: #0B1322; border: 1px solid #2C3B56; border-radius: 8px;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 16px; letter-spacing: .08em; color: #F8FAFC;
    word-break: break-all; user-select: all; }
.auth-codes { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-codes li { padding: 8px; text-align: center; background: #0B1322; border: 1px solid #2C3B56; border-radius: 8px;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 15px; color: #F8FAFC; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; font-weight: 500; color: #34B8F6;
    cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid #34B8F6; outline-offset: 2px; }

/* ux item 4: enrolment QR code (inline SVG from the server; white quiet zone for scanners) */
.auth-qr { width: 188px; max-width: 100%; margin: 10px 0 4px; padding: 0; background: #FFFFFF; border-radius: 8px; line-height: 0; }
.auth-qr svg { display: block; width: 100%; height: auto; }
