/* Ambrosia authentication pages (V2 design, auth-mockups A01–A10). */

:root {
    --auth-bg: #f3f4f6;
    --auth-ink: #112b39;
    --auth-blue: #376EB5;
    --auth-blue-dark: #2d5c99;
    --auth-muted: #64748b;
    --auth-faint: #8591a3;
    --auth-label: #334155;
    --auth-border: #dce3ed;
    --auth-border-strong: #cbd5e1;
    --auth-divider: #e3eaf2;
    --auth-danger: #b91c1c;
    --auth-danger-bg: #fef2f2;
    --auth-danger-border: #fecaca;
    --auth-info-bg: #eaf3fd;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--auth-ink);
    background: var(--auth-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--auth-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--auth-blue);
    outline-offset: 3px;
}
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* --- Page shell ------------------------------------------------------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Only the card is shown, centred; the mock-up's header, intro column and footer are intentionally omitted. */
.auth-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}


/* --- Card ------------------------------------------------------------- */

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 34px;
    border: 1px solid var(--auth-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 52px rgba(17, 43, 57, 0.055);
}

.auth-kicker {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--auth-blue);
}

.auth-card h1 {
    margin: 0 0 12px;
    font-size: 29px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.auth-lead {
    margin: 0 0 28px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--auth-muted);
}

.auth-card--status { text-align: center; }
.auth-card--status .auth-lead { margin-bottom: 20px; }

.auth-status-icon {
    height: 56px;
    width: 56px;
    margin: 0 auto 22px;
    border-radius: 14px;
    background: var(--auth-info-bg);
    color: var(--auth-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Fields ----------------------------------------------------------- */

.field { margin-bottom: 20px; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-label);
}

.field-wrap { position: relative; }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"] {
    height: 48px;
    width: 100%;
    min-width: 0;
    border: 1px solid var(--auth-border-strong);
    border-radius: 8px;
    background: #fff;
    padding: 12px 14px;
    color: var(--auth-ink);
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder { color: var(--auth-faint); }

.field input:focus {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 3px rgba(55, 110, 181, 0.15);
    outline: none;
}

.field.has-error input { border-color: var(--auth-danger); }

.field-wrap--toggle input { padding-right: 64px; }

.field-toggle {
    position: absolute;
    right: 12px;
    top: 12px;
    height: 24px;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--auth-blue);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.field-help {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--auth-muted);
}

.field-help ul { margin: 0; padding-left: 18px; }

.errorlist {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--auth-danger);
}

.auth-alert {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid var(--auth-danger-border);
    border-radius: 8px;
    background: var(--auth-danger-bg);
    color: var(--auth-danger);
    font-size: 13px;
    line-height: 1.5;
}

.auth-alert .errorlist { margin: 0; color: inherit; font-size: inherit; }

.auth-note {
    margin: 0 0 24px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--auth-info-bg);
    color: var(--auth-label);
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
}

.auth-note svg { margin-top: 2px; color: var(--auth-blue); }

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
    font-size: 12px;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    cursor: pointer;
}

.auth-check input[type="checkbox"] {
    height: 16px;
    width: 16px;
    margin: 0;
    accent-color: var(--auth-blue);
    cursor: pointer;
}

.auth-options a { font-weight: 600; }

/* --- Buttons ---------------------------------------------------------- */

.btn-primary,
.btn-secondary {
    height: 48px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-primary {
    background: var(--auth-blue);
    border: 1px solid var(--auth-blue);
    color: #fff;
}

.btn-primary:hover { background: var(--auth-blue-dark); border-color: var(--auth-blue-dark); text-decoration: none; }
.btn-primary[disabled], .btn-primary[data-submitted="1"] { opacity: 0.7; cursor: progress; }

.btn-secondary {
    height: 46px;
    background: #fff;
    border: 1px solid #d4dfed;
    color: var(--auth-label);
    font-weight: 500;
}

.btn-secondary:hover { border-color: var(--auth-blue); text-decoration: none; }

.btn-link {
    border: 0;
    padding: 0;
    background: none;
    color: var(--auth-blue);
    font-weight: 600;
    cursor: pointer;
}

.btn-link:hover { text-decoration: underline; }

/* --- Card footer ------------------------------------------------------ */

.auth-card-foot {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-divider);
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
    color: var(--auth-muted);
}

.auth-card-foot p { margin: 0 0 12px; }
.auth-card-foot p:last-child { margin-bottom: 0; }
.auth-card-foot a { font-weight: 600; }

.auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 100px;
    background: var(--auth-bg);
    color: var(--auth-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-muted);
}

.auth-back:hover { color: var(--auth-blue); }

.auth-hint {
    margin: 20px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--auth-muted);
}

/* Hidden inputs inside the card should not take layout space. */
.auth-card input[type="hidden"] { display: none; }

/* --- Responsive ------------------------------------------------------- */

@media (max-width: 760px) {
    .auth-stage { align-items: flex-start; padding: 22px 16px 32px; }
    .auth-card { padding: 27px 24px; max-width: 460px; border-radius: 14px; }
    .field input { font-size: 16px; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .auth-options { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* --- Closed registration (form shown read-only) ----------------------- */

.auth-note--warn {
    background: #fff4e0;
    color: #6b4a00;
}

.auth-note--warn svg { color: #9a6700; }
.auth-note--warn strong { display: block; margin-bottom: 2px; color: #6b4a00; }

.field input[disabled] {
    background: #f8fafc;
    color: var(--auth-faint);
    border-color: var(--auth-border);
    cursor: not-allowed;
}

form.is-closed .field label { color: var(--auth-muted); }
form.is-closed .field-help { color: var(--auth-faint); }

.btn-primary[disabled] {
    background: #cbd5e1;
    border-color: #cbd5e1;
    color: #fff;
    opacity: 1;
    cursor: not-allowed;
}

a.auth-pill:hover { background: #e9edf3; color: var(--auth-label); text-decoration: none; }

.auth-steps { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: step; text-align: left; }
.auth-steps li { position: relative; padding: 6px 0 6px 34px; font-size: 14px; color: var(--auth-label); counter-increment: step; }
.auth-steps li::before { content: counter(step); position: absolute; left: 0; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--auth-info-bg); color: var(--auth-blue); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.auth-card--status .btn-primary { margin-top: 6px; }
