:root {
    --canvas: #f1f3f5;
    --surface: #ffffff;
    --sidebar: #1a3249;
    --text: #263442;
    --muted: #6c7884;
    --brand: #1769aa;
    --positive: #18846f;
    --danger: #cf3448;
    --line: #d8dde3;
    --line-soft: #e9edf1;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    background: var(--canvas);
    font: 14px/1.5 Aptos, "Segoe UI Variable", "Segoe UI", sans-serif;
}

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 42%) 1fr; }
.auth-context { padding: clamp(40px, 8vw, 112px); color: #fff; background: var(--sidebar); display: flex; flex-direction: column; justify-content: center; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 48px; border: 1px solid rgba(255,255,255,.35); border-radius: 5px; font-size: 13px; font-weight: 750; letter-spacing: .08em; }
.eyebrow { margin: 0 0 10px; color: var(--brand); font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.auth-context .eyebrow { color: #9fc7e7; }
.auth-context h1 { max-width: 520px; margin: 0; font-size: clamp(32px, 4vw, 52px); line-height: 1.08; letter-spacing: -.025em; }
.context-copy { max-width: 460px; margin: 24px 0 44px; color: #d7e1e9; font-size: 17px; }
.status-line { display: flex; align-items: center; gap: 10px; color: #d7e1e9; font-size: 12px; font-weight: 650; }
.status-line span { width: 8px; height: 8px; border-radius: 50%; background: #55b9a5; }
.auth-panel { padding: 32px; display: grid; place-content: center; }
.auth-card { width: min(100%, 430px); padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 8px 28px rgba(26,50,73,.07); }
.form-header { margin-bottom: 28px; }
.form-header h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.2; }
.form-header p:last-child { margin: 0; color: var(--muted); }
.auth-form { display: grid; gap: 10px; }
.auth-form label { font-size: 12px; font-weight: 700; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
a { color: var(--brand); font-weight: 650; text-decoration: none; }
a:hover { text-decoration: underline; }
input[type="email"], input[type="password"], input[type="text"] { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--text); background: #fff; border: 1px solid #bfc7cf; border-radius: 4px; font: inherit; }
input:focus { outline: 3px solid rgba(23,105,170,.17); border-color: var(--brand); }
.checkbox-row { min-height: 44px; display: flex; align-items: center; gap: 9px; color: var(--muted); }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--brand); }
button { min-height: 44px; margin-top: 8px; padding: 10px 16px; color: #fff; background: var(--brand); border: 1px solid var(--brand); border-radius: 4px; font: inherit; font-weight: 750; cursor: pointer; }
button:hover { background: #115b96; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(23,105,170,.25); outline-offset: 2px; }
.field-error { margin: -4px 0 2px; color: var(--danger); font-size: 12px; font-weight: 650; }
.form-hint { margin: -3px 0 8px; color: var(--muted); font-size: 12px; }
.notice { margin: 0 0 20px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; }
.notice.success { color: #0f6757; background: #edf8f5; border-color: #b8ded5; }
.secondary-link { min-height: 44px; display: grid; place-items: center; }
.support-note { margin: 18px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.setup-copy { margin: 0 0 18px; color: var(--muted); }
.qr-code { width: fit-content; margin: 0 auto 22px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.qr-code svg { display: block; width: 180px; height: 180px; }
.recovery-codes-panel { margin: 16px 0; padding: 16px; border: 1px solid #b8ded5; border-radius: 5px; background: #f3faf8; }
.recovery-label { margin: 0 0 4px; font-size: 13px; font-weight: 750; color: var(--text); }
.recovery-hint { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.recovery-codes-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.recovery-codes-list code { padding: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 3px; font-size: 13px; font-family: 'Courier New', monospace; letter-spacing: .04em; text-align: center; }
.recovery-toggle { margin-top: 8px; border: 1px solid var(--line-soft); border-radius: 4px; }
.recovery-toggle > summary { padding: 10px 14px; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; list-style: none; }
.recovery-toggle > summary::-webkit-details-marker { display: none; }
.recovery-toggle > summary::before { content: "▸ "; }
.recovery-toggle[open] > summary::before { content: "▾ "; }
.recovery-toggle[open] > summary { border-bottom: 1px solid var(--line-soft); }
.recovery-toggle .form-hint { margin: 12px 14px 8px; }
.recovery-toggle label { display: block; margin: 0 14px; }
.recovery-toggle input { margin: 6px 14px 14px; width: calc(100% - 28px); }

@media (max-width: 760px) {
    .auth-shell { display: block; }
    .auth-context { min-height: 250px; padding: 32px 24px; }
    .brand-mark { margin-bottom: 28px; }
    .auth-context h1 { font-size: 30px; }
    .context-copy { margin: 16px 0 24px; font-size: 15px; }
    .auth-panel { padding: 20px 14px 32px; }
    .auth-card { padding: 24px 18px; }
}

.g-recaptcha { margin: 8px 0 24px; }
@media (max-width: 760px) { .g-recaptcha { margin-bottom: 10px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
