/* ── Judz.ai Early Access — authentication shell ─────────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
    background: radial-gradient(1200px 600px at 50% -10%, var(--brand-900) 0%, #0b1220 55%, #070b14 100%);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border: 1px solid var(--brand-100);
    border-radius: 16px;
    padding: 0 0 1.75rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(6, 12, 30, 0.45);
}
.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin: 0 0 1.5rem;
    padding: 1.5rem 2rem 1.25rem;
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 100%);
}
.auth-logo { height: 46px; width: auto; border-radius: 10px; box-shadow: 0 4px 14px rgba(2, 8, 20, 0.35); }
.auth-word { display: flex; flex-direction: column; line-height: 1.05; }
.auth-word strong { font-size: 1.5rem; font-weight: 800; color: #ffffff; letter-spacing: -0.01em; }
.auth-word strong span { color: var(--brand-300); }
.auth-word small { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.26em; color: #b9d4ff; text-transform: uppercase; margin-top: 0.15rem; }
.auth-title { font-size: 1.5rem; font-weight: 700; color: #0f172a; margin: 0 0 0.35rem; padding: 0 2rem; border: none; outline: none; box-shadow: none; background: none; }
.auth-subtitle { font-size: 0.9rem; color: #475569; margin: 0 0 1.25rem; padding: 0 2rem; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.auth-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.9rem; }
.auth-field label { font-size: 0.8rem; font-weight: 600; color: #334155; }
.auth-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 0.95rem;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input:focus {
    outline: none;
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px rgba(79, 151, 255, 0.25);
}
/* Suppress native browser :invalid red borders on required fields; red is shown
   only via the .invalid class when the server returns an actual error. */
.auth-input:invalid,
.auth-input:user-invalid,
.auth-input:-moz-ui-invalid {
    border-color: #cbd5e1;
    box-shadow: none;
}
.auth-input:focus:invalid,
.auth-input:focus:user-invalid {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px rgba(79, 151, 255, 0.25);
}
/* Neutralize browser autofill's blue background so fields stay on-brand white. */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a;
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 5000s ease-in-out 0s;
}
.auth-input.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}
@keyframes um-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.auth-code { letter-spacing: 0.5em; text-align: center; font-size: 1.35rem; font-weight: 600; }
.auth-btn {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 10px;
    background: var(--brand-600);
    color: #fff;
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    transition: background 0.15s ease;
}
.auth-btn:hover:not(:disabled) { background: var(--brand-700); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-foot { margin-top: 1.1rem; font-size: 0.86rem; color: #475569; text-align: center; padding: 0 2rem; }
.auth-foot a { color: var(--brand-600); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
.auth-sep { margin: 0 0.5rem; color: #cbd5e1; }
.auth-link {
    background: none; border: none; padding: 0;
    color: var(--brand-600); font-weight: 600; cursor: pointer; font-size: inherit;
}
.auth-link:hover { text-decoration: underline; }
.auth-alert {
    display: flex; align-items: center; gap: 0.55rem;
    background: #fef2f2; color: #b91c1c;
    border: 1px solid #fecaca; border-left: 4px solid #dc3545;
    border-radius: 9px; padding: 0.7rem 0.85rem; font-size: 0.88rem; font-weight: 600; margin: 0 2rem 1rem;
}
.auth-alert i { font-size: 1rem; flex: 0 0 auto; }
.auth-note {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--brand-50); color: var(--brand-800);
    border: 1px solid var(--brand-200);
    border-radius: 9px; padding: 0.65rem 0.8rem; font-size: 0.86rem; margin: 0 2rem 1rem;
}
.auth-card form { padding: 0 2rem; }

.auth-consent { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.4rem 0 1rem; }
.auth-consent-label {
    display: flex; align-items: flex-start; gap: 0.55rem;
    font-size: 0.84rem; line-height: 1.4; color: #334155; font-weight: 500; cursor: pointer;
}
.auth-consent-check { margin-top: 0.15rem; flex: 0 0 auto; width: 1rem; height: 1rem; cursor: pointer; }
.auth-consent-label a { color: var(--brand-600); font-weight: 600; text-decoration: none; }
.auth-consent-label a:hover { text-decoration: underline; }

/* ── Public legal document pages (Terms / Privacy) ─────────────────────────── */
.legal-shell { min-height: 100vh; display: flex; justify-content: center; padding: 2.5rem 1rem; background: var(--brand-50); }
.legal-card {
    width: 100%; max-width: 820px; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06); padding: 2.2rem 2.4rem;
    max-height: calc(100vh - 5rem); overflow-y: auto; scrollbar-gutter: stable;
}
.legal-brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.4rem; }
.legal-logo { height: 34px; width: auto; }
.legal-word strong { font-size: 1.1rem; color: #0f172a; }
.legal-word span { color: var(--brand-600); }
.legal-word small { display: block; font-size: 0.6rem; letter-spacing: 0.12em; color: #94a3b8; font-weight: 700; }
.legal-title { font-size: 1.55rem; color: #0f172a; margin: 0 0 0.35rem; }
.legal-meta { font-size: 0.82rem; color: #64748b; margin: 0 0 1.4rem; }
.legal-body {
    white-space: pre-wrap; word-wrap: break-word; font-family: inherit;
    font-size: 0.92rem; line-height: 1.6; color: #1e293b; margin: 0;
}
.legal-loading { color: #64748b; font-size: 0.9rem; }
.legal-alert {
    display: flex; align-items: center; gap: 0.55rem;
    background: #fef2f2; color: #b91c1c;
    border: 1px solid #fecaca; border-left: 4px solid #dc3545;
    border-radius: 9px; padding: 0.7rem 0.85rem; font-size: 0.88rem; font-weight: 600; margin-bottom: 1rem;
}
.legal-foot { margin-top: 1.8rem; font-size: 0.86rem; }
.legal-foot a { color: var(--brand-600); font-weight: 600; text-decoration: none; }
.legal-foot a:hover { text-decoration: underline; }

@media (max-width: 560px) {
    .auth-row { grid-template-columns: 1fr; }
    .auth-title, .auth-subtitle, .auth-card form, .auth-foot { padding-left: 1.25rem; padding-right: 1.25rem; }
    .auth-alert, .auth-note { margin-left: 1.25rem; margin-right: 1.25rem; }
    .auth-brand { padding: 1.25rem 1.25rem 1rem; }
}

/* ── Login loading glass: shown while the API data service is still warming up ── */
.auth-glass {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(7, 11, 20, 0.6);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    animation: auth-glass-in 0.25s ease;
}
.auth-glass-card {
    max-width: 26rem;
    width: 100%;
    text-align: center;
    padding: 2rem 2.25rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(0, 140, 255, 0.25);
    box-shadow: 0 24px 60px rgba(6, 12, 30, 0.45);
}
.auth-glass-card h2 { margin: 0.9rem 0 0.4rem; font-size: 1.25rem; color: #10233f; }
.auth-glass-card p { margin: 0 0 0.75rem; font-size: 0.9rem; color: #46566c; }
.auth-glass-meta {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #66758a;
}
.auth-glass-spinner {
    display: inline-block;
    font-size: 2.1rem;
    color: #008cff;
    animation: auth-glass-pulse 1.4s ease-in-out infinite;
}
@keyframes auth-glass-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes auth-glass-pulse {
    0%, 100% { transform: scale(1); opacity: 0.65; }
    50% { transform: scale(1.12); opacity: 1; }
}
