:root {
    color-scheme: light;
    --auth-bg: #f8f5f2;
    --auth-card: #ffffff;
    --auth-ink: #241f1b;
    --auth-muted: #6f655e;
    --auth-border: #e4dbd4;
    --auth-accent: #8f4d65;
    --auth-accent-dark: #71384e;
    --auth-success-bg: #edf8f0;
    --auth-success: #245f37;
    --auth-error: #a72d32;
}

* { box-sizing: border-box; }

.auth-page {
    --auth-bg: #F2F0EF;
    --auth-card: #E7E4DF;
    --auth-ink: #000000;
    --auth-muted: #5F5E5B;
    --auth-border: #ACABA9;
    --auth-accent: #F0E449;
    --auth-accent-dark: #D9C930;
    --auth-success-bg: #F2F0EF;
    --auth-success: #000000;
    --auth-error: #000000;
    margin: 0;
    min-height: 100vh;
    background: var(--auth-bg);
    color: var(--auth-ink);
    font-family: Inter, "Avenir Next", Montserrat, Arial, sans-serif;
}

.auth-shell {
    width: min(100% - 2rem, 32rem);
    margin: 0 auto;
    padding: clamp(2rem, 8vh, 5rem) 0;
}

.auth-brand {
    display: block;
    margin-bottom: 1.25rem;
    color: var(--auth-ink);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-align: center;
    text-decoration: none;
}

.auth-card {
    padding: clamp(1.5rem, 5vw, 2.5rem);
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: .5rem;
    box-shadow: 0 1.25rem 3.5rem rgba(0, 0, 0, .12);
}

.auth-card__header { margin-bottom: 1.5rem; }
.auth-card h1 { margin: .3rem 0 .6rem; font-size: clamp(1.9rem, 5vw, 2.25rem); line-height: 1.1; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: .55rem; margin: 0; color: var(--auth-ink); font-size: .76rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.auth-eyebrow::before { width: 1.75rem; height: .3rem; background: var(--auth-accent); content: ""; }
.auth-intro { margin: 0; color: var(--auth-muted); line-height: 1.65; }
.auth-form { display: grid; gap: 1rem; }
.auth-page .field { display: grid; gap: .4rem; }
.auth-page .field label { font-size: .92rem; font-weight: 750; }

.auth-page .field input {
    width: 100%;
    min-height: 2.9rem;
    padding: .7rem .8rem;
    color: var(--auth-ink);
    background: #F2F0EF;
    border: 1px solid var(--auth-border);
    border-radius: .35rem;
    font: inherit;
}

.auth-page .field input:focus {
    border-color: var(--auth-ink);
    outline: 3px solid var(--auth-accent);
    outline-offset: 2px;
}

.auth-page .field-error {
    margin: 0;
    padding-inline-start: .55rem;
    color: var(--auth-error);
    border-inline-start: 3px solid var(--auth-accent);
    font-size: .86rem;
    font-weight: 700;
}

.auth-page .check-field { display: flex; gap: .6rem; align-items: center; color: var(--auth-muted); font-size: .9rem; }
.auth-page .check-field input { width: 1rem; height: 1rem; accent-color: var(--auth-accent); }

.auth-page .button {
    min-height: 2.85rem;
    padding: .7rem 1rem;
    border: 1px solid var(--auth-ink);
    border-radius: .35rem;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.auth-page .button:focus-visible,
.auth-links a:focus-visible,
.auth-brand:focus-visible {
    outline: 3px solid var(--auth-accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px var(--auth-ink);
}

.auth-page .button--primary { color: var(--auth-ink); background: var(--auth-accent); }
.auth-page .button--primary:hover { background: var(--auth-accent-dark); }
.auth-page .button--secondary { color: var(--auth-ink); background: #F2F0EF; border-color: var(--auth-ink); }
.auth-links { display: grid; gap: .55rem; margin-top: 1.25rem; text-align: center; }
.auth-links a { color: var(--auth-ink); font-weight: 700; text-decoration-line: underline; text-decoration-color: var(--auth-accent); text-decoration-thickness: .16em; text-underline-offset: .2em; }
.auth-secondary-form { margin-top: .75rem; }
.auth-secondary-form .button { width: 100%; }
.auth-page .alert { margin-bottom: 1rem; padding: .8rem 1rem; color: var(--auth-ink); background: var(--auth-success-bg); border: 1px solid var(--auth-ink); border-inline-start: 5px solid var(--auth-accent); border-radius: .35rem; line-height: 1.45; }
.auth-page .alert--success { color: var(--auth-success); }

.account-summary { display: grid; gap: .75rem; margin: 0 0 1.25rem; }
.account-summary div { display: grid; grid-template-columns: 5rem 1fr; gap: .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--auth-border); }
.account-summary dt { color: var(--auth-muted); font-weight: 650; }
.account-summary dd { margin: 0; font-weight: 750; overflow-wrap: anywhere; }
.dashboard-note { margin: 0 0 1.25rem; color: var(--auth-muted); line-height: 1.65; }

[dir="rtl"] .auth-eyebrow { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .auth-page input[type="email"],
[dir="rtl"] .auth-page input[type="password"] { direction: ltr; text-align: left; }

@media (max-width: 30rem) {
    .auth-shell { width: min(100% - 1.5rem, 32rem); padding: 1rem 0; }
    .auth-card { padding: 1.25rem; border-radius: .35rem; }
}

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

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .75rem; margin: 1rem 0; }
.metric { padding: 1rem; border-radius: .75rem; background: #f7f3ef; }
.metric strong { display: block; font-size: 1.6rem; }
.action-links { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
