/* ═══════════════════════════════════════════════════════════════════════════
   Sign-in / account pages — shared by the app (templates/*.html extending
   base.html) and the M&E dashboard auth blueprint (flask_auth/templates/auth).
   Builds on ui.css (.field, .ui-btn, .notice).
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-shell {
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    width: 100%; max-width: 420px; margin: 1.5rem auto 2rem;
}
.auth-shell.wide { max-width: 520px; }

.auth-card {
    width: 100%; box-sizing: border-box; background: var(--surface);
    border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
    padding: 2rem 2rem 1.75rem;
}

.auth-brand { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1.5rem; text-decoration: none; }
.auth-mark {
    flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.auth-brand strong { display: block; font-size: 0.95rem; color: var(--text-1); line-height: 1.2; letter-spacing: -0.01em; }
.auth-brand small { display: block; font-size: 0.75rem; color: var(--text-3); line-height: 1.3; }

.auth-card h1 { margin: 0; font-size: 1.35rem; line-height: 1.25; letter-spacing: -0.02em; color: var(--text-1); }
.auth-lead { margin: 0.35rem 0 0; font-size: 0.875rem; color: var(--text-2); line-height: 1.5; }

.auth-card .notice { margin-top: 1rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.95rem; margin-top: 1.35rem; }
.auth-form .field > label { text-transform: none; letter-spacing: 0; margin: 0; }
.auth-form .field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.auth-form .field-row label { margin: 0; font-size: 0.8rem; font-weight: 600; color: var(--text-1); text-transform: none; letter-spacing: 0; }
.auth-form .field-row a { font-size: 0.78rem; font-weight: 500; }
.auth-form .field input:not([type="checkbox"]):not([type="radio"]),
.auth-form .field select { padding: 0.6rem 0.75rem; font-size: 0.9rem; }

.ui-btn.block { width: 100%; padding: 0.65rem 1rem; font-size: 0.9rem; }
.auth-form .ui-btn.block { margin-top: 0.35rem; }
.auth-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.25rem; }

.auth-card a:not(.ui-btn) { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-card a:not(.ui-btn):hover { text-decoration: underline; }

.auth-links {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem;
    margin-top: 1.35rem; padding-top: 1.1rem; border-top: 1px solid var(--border);
    font-size: 0.82rem; color: var(--text-2);
}
.auth-links.center { justify-content: center; }
.auth-foot { margin: 0; font-size: 0.78rem; color: var(--text-3); text-align: center; }
.auth-foot a { color: var(--text-2); }

/* App pages: centre the flash messages above the card */
main.container:has(.auth-shell) > .flash-container { max-width: 420px; margin: 0.5rem auto -0.5rem; }
main.container:has(.auth-shell.wide) > .flash-container { max-width: 520px; }

/* Standalone layout (flask_auth/templates/auth/base.html) */
body.auth-body {
    min-height: 100vh; margin: 0; display: flex; flex-direction: column; justify-content: center;
    background:
        radial-gradient(1200px 500px at 50% -10%, var(--primary-dim), transparent 70%),
        var(--bg);
}
body.auth-body .auth-shell { margin: 2rem auto; padding: 0 16px; box-sizing: border-box; max-width: calc(420px + 32px); }

@media (max-width: 520px) {
    .auth-shell { margin-top: 0.5rem; }
    .auth-card { padding: 1.5rem 1.25rem 1.35rem; border-radius: 12px; }
    .auth-links { flex-direction: column; align-items: flex-start; }
    .auth-links.center { align-items: center; }
}
