/* ===================================================================
   auth.css — Login, RequestAccount, ChangePassword, SetupMfa, VerifyMfa.
   Scoped to pages that use _LayoutAuth (and the standalone first-time
   flow views that opt in). Match the Phase 9 mockup: left dark marketing
   panel + right white form panel.
   =================================================================== */

:root {
    --acumass-teal: #00c896;
    --acumass-teal-dark: #0ba17c;
    --panel-dark: #0a2628;
    --panel-dark-ink: #ffffff;
    --panel-dark-muted: #a4b5b7;
    --ink: #1a2626;
    --ink-muted: #6b7f82;
    --ink-faint: #a4b5b7;
    --surface: #ffffff;
    --surface-alt: #f6f8f8;
    --border: #e4e9e9;
    --border-strong: #c7d1d1;
    --danger: #d84a4a;
    --danger-bg: #fdecec;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--surface);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--acumass-teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Shell ---------- */

.auth-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 1.6fr;
    min-height: 100vh;
}
@@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .section-left { display: none; }
}

/* ---------- Left (dark) ---------- */

.section-left {
    background: var(--panel-dark);
    color: var(--panel-dark-ink);
    padding: 36px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.section-left-top { }
.section-left-mid { max-width: 420px; }
.section-left-foot {
    font-size: 13px;
    color: var(--panel-dark-muted);
}
.section-left-foot a { color: var(--panel-dark-muted); text-decoration: underline; }

.brand {
    display: inline-block;
    color: var(--acumass-teal);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.marketing-headline {
    font-size: 42px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 20px;
    font-weight: 700;
}
.marketing-sub {
    color: var(--panel-dark-muted);
    font-size: 16px;
    margin: 0 0 40px;
}

/* Feature bullets (Login) */
.feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 22px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list li > div { display: flex; flex-direction: column; }
.feature-list strong { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.feature-list span { color: var(--panel-dark-muted); font-size: 14px; }
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(0, 200, 150, 0.14);
    color: var(--acumass-teal);
    font-size: 16px;
    flex-shrink: 0;
}

/* Step list (RequestAccount) */
.step-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 24px; }
.step-list li { display: flex; gap: 14px; align-items: flex-start; }
.step-list li > div { display: flex; flex-direction: column; }
.step-list strong { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.step-list span { color: var(--panel-dark-muted); font-size: 14px; }
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--panel-dark-muted);
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.step-num-active {
    background: var(--acumass-teal);
    border-color: var(--acumass-teal);
    color: #002018;
}

/* ---------- Right (form) ---------- */

.section-right {
    position: relative;
    padding: 36px 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth-topbar {
    position: absolute;
    top: 20px; right: 24px;
    display: flex; gap: 10px;
    align-items: center;
}
.auth-form-wrap {
    width: 100%;
    max-width: 420px;
    margin: auto 0;
    padding: 20px 0;
}
.auth-form-wrap.wide { max-width: 560px; }

.auth-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}
.auth-sub { color: var(--ink-muted); font-size: 14px; margin: 0 0 24px; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-label { font-size: 13px; font-weight: 500; color: var(--ink); }
.field-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field-input:focus {
    outline: none;
    border-color: var(--acumass-teal);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.14);
}
.field-input.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(216, 74, 74, 0.14); }
.field-with-icon { position: relative; }
.field-with-icon .field-input { padding-right: 40px; }
.field-icon-btn {
    position: absolute; right: 6px; top: 50%;
    transform: translateY(-50%);
    background: transparent; border: 0;
    width: 32px; height: 32px;
    cursor: pointer;
    color: var(--ink-muted);
    font-size: 16px;
}
.field-link { font-size: 13px; color: var(--acumass-teal-dark); text-decoration: underline; }
.field-check {
    display: flex; gap: 8px; align-items: center;
    font-size: 14px; color: var(--ink);
}
.field-hint { font-size: 12px; color: var(--ink-muted); }

/* Field pair (two columns) */
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Section header inside form */
.form-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    margin: 10px 0 -4px;
}

/* Volume buckets */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    color: var(--ink);
}
.chip-btn[aria-pressed="true"] {
    border-color: var(--acumass-teal);
    background: rgba(0, 200, 150, 0.08);
    color: var(--acumass-teal-dark);
    font-weight: 500;
}

/* Use-case cards (checkbox tiles) */
.card-check-row { display: flex; gap: 10px; }
.card-check {
    flex: 1;
    display: flex; gap: 10px; align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--surface);
}
.card-check:has(input:checked) {
    border-color: var(--acumass-teal);
    background: rgba(0, 200, 150, 0.08);
}
.card-check input[type="checkbox"] { accent-color: var(--acumass-teal); }

/* Password strength meter */
.pwd-strength { display: flex; gap: 4px; margin-top: 6px; }
.pwd-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.pwd-bar.filled { background: var(--acumass-teal); }
.pwd-rules { display: flex; gap: 14px; font-size: 12px; color: var(--ink-muted); margin-top: 6px; flex-wrap: wrap; }
.pwd-rules .met { color: var(--acumass-teal-dark); }

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.btn-primary {
    background: var(--acumass-teal-dark);
    color: #fff;
}
.btn-primary:hover { background: #0a8b6a; }
.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-alt); }
.btn-secondary:disabled { opacity: 0.7; cursor: not-allowed; }

.ms-logo {
    width: 16px; height: 16px;
    background:
        linear-gradient(to right, #F25022 50%, #7FBA00 50%) top / 100% 50% no-repeat,
        linear-gradient(to right, #00A4EF 50%, #FFB900 50%) bottom / 100% 50% no-repeat;
    display: inline-block;
}

/* Divider */
.auth-divider {
    display: flex; align-items: center; gap: 12px;
    color: var(--ink-faint); font-size: 13px;
    margin: 6px 0;
}
.auth-divider::before, .auth-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
}

/* Error banner */
.auth-error {
    display: flex; gap: 10px; align-items: flex-start;
    background: var(--danger-bg);
    color: #8a2b2b;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
}
.auth-error-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 999px;
    background: #c43b3b; color: #fff; font-weight: 700; font-size: 12px;
    flex-shrink: 0;
}

/* Footer links on the form */
.auth-foot-link {
    text-align: center;
    color: var(--ink-muted);
    font-size: 14px;
    margin: 6px 0 0;
}
.auth-foot-link a { font-weight: 600; }
.auth-foot {
    position: absolute;
    bottom: 20px; left: 0; right: 0;
    text-align: center;
    color: var(--ink-muted);
    font-size: 13px;
}
.auth-foot-sep { margin: 0 6px; color: var(--ink-faint); }

/* Top-left "Already have account" link on RequestAccount */
.auth-top-left {
    position: absolute;
    top: 20px; left: 44px;
    font-size: 14px;
    color: var(--ink-muted);
}
.auth-top-left a { font-weight: 600; margin-left: 4px; }

/* QR card (SetupMfa) */
.mfa-qr-wrap {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px;
    background: var(--surface-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.mfa-qr { width: 200px; height: 200px; }
.mfa-secret {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    background: var(--surface);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px dashed var(--border-strong);
    font-size: 13px;
    letter-spacing: 1px;
    user-select: all;
    display: inline-block;
    margin-top: 10px;
    word-break: break-all;
}
.mfa-code-input {
    letter-spacing: 10px;
    font-size: 22px;
    text-align: center;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* reCAPTCHA host centers */
.g-recaptcha { display: flex; justify-content: flex-start; }
