/* ============================================================
   Medicore — Auth Security Design System v2
   Full-Screen Premium Login + Dramatic Lockout
   ============================================================ */

/* ---------- 1. Base Tokens ---------- */
:root {
    color-scheme: light;
    --auth-bg: #0f1624;
    --auth-surface: rgba(255,255,255,0.05);
    --auth-surface-solid: #ffffff;
    --auth-surface-muted: rgba(255,255,255,0.03);
    --auth-border: rgba(255,255,255,0.10);
    --auth-border-solid: #e2e8f0;
    --auth-text: #0f172a;
    --auth-text-light: #f1f5f9;
    --auth-text-soft: #475569;
    --auth-text-muted: #64748b;
    --auth-primary: #0f172a;
    --auth-primary-hover: #1e293b;
    --auth-accent: #0d9488;
    --auth-accent-hover: #0f766e;
    --auth-accent-glow: rgba(13,148,136,0.28);
    --auth-info-bg: #eff6ff;
    --auth-info-border: #bfdbfe;
    --auth-info-text: #1e40af;
    --auth-warning-bg: #fffbeb;
    --auth-warning-border: #fde68a;
    --auth-warning-text: #92400e;
    --auth-success-bg: #f0fdf4;
    --auth-success-border: #bbf7d0;
    --auth-success-text: #166534;
    --auth-danger-bg: #fff1f2;
    --auth-danger-border: #fecdd3;
    --auth-danger-text: #be123c;
    --auth-shadow-card: 0 32px 80px -16px rgba(0,0,0,0.5);
    --auth-shadow-glow: 0 0 60px rgba(13,148,136,0.15);
    --auth-focus-ring: rgba(13,148,136,0.25);
    --auth-brand-start: #0f3c47;
    --auth-brand-mid: #0f5c69;
    --auth-brand-end: #0f172a;
    --auth-brand-orb: rgba(13,148,136,0.24);
    --auth-font-heading: 'Cairo', Tahoma, Arial, sans-serif;
    --auth-font-body: 'Cairo', Tahoma, Arial, sans-serif;
    --auth-radius-sm: 0.75rem;
    --auth-radius-md: 1rem;
    --auth-radius-lg: 1.5rem;
    --auth-radius-xl: 2rem;

    /* Lockout-specific */
    --auth-lockout-perm-from: #450a0a;
    --auth-lockout-perm-to: #27060a;
    --auth-lockout-temp-from: #431407;
    --auth-lockout-temp-to: #1c0805;
}

/* ---------- 2. Reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
html,body { margin: 0; min-height: 100%; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

/* Full-screen dark gradient background */
body.auth-page-login {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(13,148,136,0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(14,165,233,0.14) 0%, transparent 45%),
        linear-gradient(160deg, #0f1624 0%, #111827 50%, #0b0f1a 100%);
    font-family: var(--auth-font-body);
    color: var(--auth-text-light);
    overflow-x: hidden;
}

/* Full-screen centered shell */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
}

.auth-shell--centered {
    align-items: center;
    padding: clamp(1rem, 3vw, 2rem);
}

body.auth-security-body:not(.auth-page-login):not(.auth-page-lockout-temp):not(.auth-page-lockout-perm) {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 16% 42%, rgba(13,148,136,0.08) 0%, transparent 56%),
        radial-gradient(ellipse at 84% 16%, rgba(14,165,233,0.08) 0%, transparent 42%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    font-family: var(--auth-font-body);
    color: var(--auth-text);
}

/* ── Two-column login grid ── */
.auth-shell--wide { padding: 0; }

.auth-login-grid {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

/* ── Brand Panel (left) ── */
.auth-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4rem 3.5rem;
    min-height: 100vh;
    background:
        radial-gradient(circle at 80% 10%, var(--auth-brand-orb), transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(14,165,233,0.16), transparent 40%),
        linear-gradient(160deg, var(--auth-brand-start) 0%, var(--auth-brand-mid) 50%, var(--auth-brand-end) 100%);
    color: #ffffff;
}

/* Decorative orbs */
.auth-brand-panel::before {
    content: "";
    position: absolute;
    top: -5rem; right: -5rem;
    width: 18rem; height: 18rem;
    border-radius: 999px;
    background: rgba(13,148,136,0.12);
    pointer-events: none;
}
.auth-brand-panel::after {
    content: "";
    position: absolute;
    bottom: -4rem; left: -4rem;
    width: 14rem; height: 14rem;
    border-radius: 999px;
    background: rgba(14,165,233,0.10);
    pointer-events: none;
}

.auth-brand-panel > * { position: relative; z-index: 1; }

/* Brand top section */
.auth-brand-top { display: flex; flex-direction: column; gap: 1.5rem; }

.auth-brand-badge {
    width: 4.5rem; height: 4.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 900;
    overflow: hidden;
    padding: 0.4rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    backdrop-filter: blur(8px);
}

.auth-brand-logo {
    max-width: 100%; max-height: 100%;
    object-fit: contain; display: block;
}

.auth-brand-title {
    margin: 0;
    font-size: 2.2rem;
    line-height: 1.15;
    font-weight: 900;
    font-family: var(--auth-font-heading);
    letter-spacing: -0.02em;
}

.auth-kicker {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--auth-font-heading);
    color: rgba(255,255,255,0.55);
    margin-bottom: 0.5rem;
}

.auth-brand-copy {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.65);
}

/* Security badges */
.auth-brand-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.auth-brand-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    font-family: var(--auth-font-heading);
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.auth-brand-badge-pill svg {
    width: 0.8rem; height: 0.8rem;
    stroke: currentColor; stroke-width: 2.5;
    fill: none; flex-shrink: 0;
}

/* Brand bottom quote */
.auth-brand-quote {
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--auth-radius-md);
    background: rgba(255,255,255,0.06);
    padding: 1.25rem 1.25rem;
    backdrop-filter: blur(6px);
    margin-top: auto;
}
.auth-brand-quote > * { margin: 0; }
.auth-brand-quote > * + * { margin-top: 0.5rem; }
.auth-brand-quote p { font-size: 0.9rem; line-height: 1.7; color: rgba(255,255,255,0.75); }
.auth-brand-quote strong { color: #ffffff; font-size: 0.85rem; }

/* ── Login Form Panel (right) ── */
.auth-login-card {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 4.5rem;
    overflow-y: auto;
    min-height: 100vh;
}

/* ── Topbar inside card ── */
.auth-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.auth-heading { text-align: right; }
.auth-heading > * + * { margin-top: 0.35rem; }

.auth-title {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 800;
    color: var(--auth-text);
    font-family: var(--auth-font-heading);
}

.auth-copy {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--auth-text-muted);
}

.auth-copy strong, .auth-copy b { color: var(--auth-text); }

/* Kicker inside light card */
.auth-login-card .auth-kicker {
    color: var(--auth-accent);
    background: none;
    letter-spacing: 0.08em;
}

/* ── Alerts ── */
.auth-message-stack > * + * { margin-top: 0.75rem; }

.auth-alert {
    border-radius: var(--auth-radius-md);
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    line-height: 1.65;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}
.auth-alert > * { margin: 0; }
.auth-alert > * + * { margin-top: 0.25rem; }

.auth-alert--danger  { background:#fff1f2; border:1px solid #fecdd3; color:#be123c; }
.auth-alert--warning { background:#fffbeb; border:1px solid #fde68a; color:#92400e; }
.auth-alert--success { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; }
.auth-alert--info    { background:#eff6ff; border:1px solid #bfdbfe; color:#1e40af; }

/* ── Info notice ── */
.auth-subcard {
    border-radius: var(--auth-radius-md);
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    line-height: 1.65;
}
.auth-subcard > * { margin: 0; }
.auth-subcard > * + * { margin-top: 0.5rem; }

.auth-subcard--info    { background:#eff6ff; border:1px solid #bfdbfe; color:#1e40af; }
.auth-subcard--warning { background:#fffbeb; border:1px solid #fde68a; color:#92400e; }
.auth-subcard--danger  { background:#fff1f2; border:1px solid #fecdd3; color:#be123c; }
.auth-subcard--success { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; }

/* ── Form ── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-label {
    display: block;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Field wrapper for icon */
.auth-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-field-icon {
    position: absolute;
    inset-inline-end: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #9ca3af;
    display: flex;
    align-items: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}
.auth-field-icon svg {
    width: 1rem; height: 1rem;
    stroke: currentColor; stroke-width: 2;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* Show/hide toggle */
.auth-field-toggle {
    position: absolute;
    inset-inline-start: 0.75rem;
    top: 50%; transform: translateY(-50%);
    background: transparent; border: 0;
    cursor: pointer; color: #9ca3af;
    padding: 0.25rem;
    display: flex; align-items: center;
    transition: color 0.2s;
    z-index: 2;
}
.auth-field-toggle:hover { color: var(--auth-accent); }
.auth-field-toggle svg {
    width: 1rem; height: 1rem;
    stroke: currentColor; stroke-width: 2;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
    pointer-events: none;
}

/* Input */
.auth-input,
.auth-login-card input[type="text"],
.auth-login-card input[type="password"],
.auth-login-card input[type="email"],
.auth-login-card select,
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"],
.auth-card select {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--auth-radius-sm);
    background: #f9fafb;
    color: #111827;
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}
.auth-field-wrap--has-toggle .auth-input,
.auth-field-wrap--has-toggle input.auth-input {
    padding-inline-start: 2.75rem;
}
.auth-input::placeholder,
.auth-login-card input::placeholder { color: #9ca3af; }

.auth-input:focus,
.auth-login-card input:focus,
.auth-login-card select:focus,
.auth-card input:focus,
.auth-card select:focus {
    border-color: var(--auth-accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--auth-focus-ring);
}

/* OTP code input */
.auth-login-card input[autocomplete="one-time-code"],
.auth-card input[autocomplete="one-time-code"] {
    direction: ltr;
    letter-spacing: 0.28em;
    text-align: center;
}

/* Grid / layout helpers */
.auth-grid         { display: grid; gap: 1rem; }
.auth-grid--two    { grid-template-columns: 1fr; }
.auth-grid__full   { grid-column: 1 / -1; }

/* Inline row (remember + forgot) */
.auth-inline-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #4b5563;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}
.auth-login-card .auth-checkbox input,
.auth-card .auth-checkbox input {
    width: 1rem; height: 1rem;
    accent-color: var(--auth-accent);
    margin: 0; padding: 0; cursor: pointer;
    flex-shrink: 0;
    box-shadow: none;
    border: none;
}

.auth-link-inline {
    appearance: none; background: transparent; border: 0;
    color: var(--auth-accent); cursor: pointer; font: inherit;
    font-size: 0.85rem; font-weight: 700; margin: 0; padding: 0;
    text-align: start; text-decoration: none;
    transition: color 0.18s;
}
.auth-link-inline:hover { color: var(--auth-accent-hover); text-decoration: underline; }

/* ── Buttons ── */
.auth-actions { display: flex; flex-direction: column; gap: 0.75rem; }

.auth-btn,
.auth-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    border-radius: var(--auth-radius-sm);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    font-family: var(--auth-font-heading);
    padding: 0.875rem 1.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
    cursor: pointer;
}
.auth-btn:not(:disabled):active { transform: scale(0.98); }
.auth-btn:disabled, .auth-link-btn[aria-disabled="true"] {
    opacity: 0.6; cursor: not-allowed; transform: none !important;
}

/* Accent — full gradient */
.auth-btn--accent, .auth-link-btn--accent {
    background: linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-accent-hover) 100%);
    border-color: var(--auth-accent);
    color: #ffffff;
    box-shadow: 0 4px 24px -4px var(--auth-accent-glow);
}
.auth-btn--accent:hover:not(:disabled), .auth-link-btn--accent:hover {
    background: linear-gradient(135deg, var(--auth-accent-hover) 0%, #115e59 100%);
    box-shadow: 0 6px 28px -4px var(--auth-accent-glow);
    transform: translateY(-1px);
}

/* Primary dark */
.auth-btn--primary, .auth-link-btn--primary {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}
.auth-btn--primary:hover:not(:disabled), .auth-link-btn--primary:hover {
    background: #1f2937; border-color: #1f2937;
    box-shadow: 0 4px 20px -4px rgba(0,0,0,0.3);
}

@media (max-width: 767px) {
    .auth-shell--centered {
        align-items: flex-start;
        padding: 1rem;
    }

    .auth-shell--centered .auth-card {
        width: min(100%, 34rem);
        margin-inline: auto;
        border-radius: 1.5rem;
        padding: 1.25rem;
    }

    .auth-shell--centered .auth-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-shell--centered .auth-link-btn--compact {
        width: 100%;
        justify-content: center;
    }
}

/* Ghost */
.auth-btn--ghost, .auth-link-btn--ghost {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #374151;
}
.auth-btn--ghost:hover:not(:disabled), .auth-link-btn--ghost:hover {
    background: #f3f4f6;
    border-color: var(--auth-accent);
    color: var(--auth-accent);
}

.auth-link-btn--compact { width: auto; flex: none; }

/* Error lists */
.auth-login-card .errorlist,
.auth-card .errorlist {
    color: #be123c;
    font-size: 0.8rem;
    line-height: 1.6;
    margin: 0;
    padding-inline-start: 1rem;
    list-style: disc;
}
.auth-login-card .errorlist li + li,
.auth-card .errorlist li + li { margin-top: 0.15rem; }

/* ── General auth-card (standalone pages like MFA) ── */
.auth-stack { width: 100%; max-width: 48rem; }
.auth-stack--narrow { max-width: 30rem; }
.auth-stack--medium { max-width: 40rem; }
.auth-stack > * + * { margin-top: 1rem; }

.auth-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--auth-radius-lg);
    box-shadow: 0 20px 60px -12px rgba(0,0,0,0.18), 0 4px 16px -4px rgba(0,0,0,0.08);
    padding: 2rem;
}
.auth-card > * + * { margin-top: 1.5rem; }

/* Utility */
.auth-hidden, .hidden { display: none !important; }
.auth-center { text-align: center; }
.auth-heading--center { text-align: center; }
.auth-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.auth-text-link { color: var(--auth-accent); font-weight: 700; text-decoration: none; }
.auth-text-link:hover { color: var(--auth-accent-hover); text-decoration: underline; }

.auth-status { min-height: 1.25rem; font-size: 0.88rem; font-weight: 700; }
.auth-status--neutral { color: var(--auth-text-muted); }
.auth-status--success { color: #166534; }
.auth-status--danger  { color: #be123c; }

/* Steps */
.auth-steps { display: grid; gap: 0.75rem; }
.auth-step {
    display: flex; align-items: flex-start; gap: 0.75rem;
    border: 1px solid #e5e7eb; border-radius: var(--auth-radius-md);
    background: #f9fafb; padding: 0.875rem;
}
.auth-step__index {
    width: 1.75rem; height: 1.75rem; flex: none;
    border-radius: 999px; background: var(--auth-accent);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 900;
}
.auth-step__body > * { margin: 0; }
.auth-step__body > * + * { margin-top: 0.25rem; }
.auth-step__title { color: #111827; font-size: 0.9rem; font-weight: 800; }
.auth-step__copy  { color: #6b7280; font-size: 0.85rem; line-height: 1.7; }

/* Tabs */
.auth-tabs {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    padding: 0.35rem; border-radius: var(--auth-radius-md);
    background: #f3f4f6;
}
.auth-tab {
    flex: 1 1 120px; min-width: 100px;
    border: 0; border-radius: calc(var(--auth-radius-md) - 0.1rem);
    background: transparent; color: #6b7280;
    cursor: pointer; font-size: 0.88rem; font-weight: 700;
    padding: 0.75rem 0.875rem;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    font-family: var(--auth-font-heading);
}
.auth-tab:hover { color: var(--auth-accent); }
.auth-tab.is-active {
    background: #fff; color: var(--auth-accent);
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}

/* Code chips (backup codes) */
.auth-code-grid {
    display: grid; gap: 0.5rem; direction: ltr;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.auth-code-chip {
    display: block; border: 1px solid #fde68a; border-radius: var(--auth-radius-sm);
    background: #fefce8; color: #111827;
    font-family: ui-monospace, monospace; font-size: 0.9rem;
    font-weight: 700; letter-spacing: 0.15em;
    padding: 0.875rem 1rem; text-align: center;
}

/* Metrics */
.auth-metrics {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.auth-metric {
    border: 1px solid #e5e7eb; border-radius: var(--auth-radius-md); padding: 1rem;
}
.auth-metric > * { margin: 0; }
.auth-metric > * + * { margin-top: 0.25rem; }
.auth-metric--success { background:#f0fdf4; border-color:#bbf7d0; color:#166534; }

.auth-subtitle { font-size: 1rem; font-weight: 800; color: inherit; font-family: var(--auth-font-heading); }
.auth-value { font-size: 1rem; font-weight: 800; }

.auth-list { margin: 0; padding-inline-start: 1.25rem; }
.auth-list > li + li { margin-top: 0.2rem; }

/* ── Modal ── */
body.auth-modal-open { overflow: hidden; }
.auth-modal {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    padding: 1rem;
    animation: auth-modal-fade 0.2s ease;
}
@keyframes auth-modal-fade { from{opacity:0} to{opacity:1} }
.auth-modal__dialog {
    min-height: 100%; display: flex; align-items: center; justify-content: center;
}
.auth-modal__panel {
    width: min(100%, 38rem);
    max-height: min(calc(100dvh - 2rem), 42rem);
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: var(--auth-radius-lg);
    box-shadow: 0 40px 80px -16px rgba(0,0,0,0.4);
    overflow: auto;
    animation: auth-panel-slide 0.25s ease;
}
@keyframes auth-panel-slide {
    from{opacity:0;transform:translateY(1.5rem) scale(0.96)}
    to  {opacity:1;transform:translateY(0) scale(1)}
}
.auth-modal__header, .auth-modal__body, .auth-modal__footer { padding: 1.5rem; }
.auth-modal__header { border-bottom: 1px solid #f3f4f6; }
.auth-modal__footer { border-top: 1px solid #f3f4f6; }
.auth-modal__body > * + * { margin-top: 0.75rem; }

/* ── Actions split ── */
.auth-actions--split { flex-direction: column; gap: 0.75rem; }

/* ── Symbol icon ── */
.auth-symbol {
    width: 5rem; height: 5rem; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    margin-inline: auto; position: relative;
}
.auth-symbol svg {
    width: 2.25rem; height: 2.25rem;
    stroke: currentColor; stroke-width: 2.5;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.auth-symbol--danger  { background:#fff1f2; border:2px solid #fecdd3; color:#be123c; }
.auth-symbol--warning { background:#fffbeb; border:2px solid #fde68a; color:#d97706; }
.auth-symbol--info    { background:#eff6ff; border:2px solid #bfdbfe; color:#1e40af; }
.auth-symbol--success { background:#f0fdf4; border:2px solid #bbf7d0; color:#166534; }

/* ============================================================
   LOCKOUT PAGE
   ============================================================ */

body.auth-page-lockout-perm {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(239,68,68,0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(220,38,38,0.20) 0%, transparent 45%),
        linear-gradient(160deg, #1c0505 0%, #27060a 45%, #0d0202 100%);
    font-family: var(--auth-font-body);
    color: #f8fafc;
    position: relative;
    overflow-x: hidden;
}

body.auth-page-lockout-temp {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(251,146,60,0.22) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(234,88,12,0.18) 0%, transparent 45%),
        linear-gradient(160deg, #1c0d02 0%, #2d1507 45%, #0d0500 100%);
    font-family: var(--auth-font-body);
    color: #f8fafc;
    position: relative;
    overflow-x: hidden;
}

/* Warning stripes */
body.auth-page-lockout-perm::before,
body.auth-page-lockout-temp::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    opacity: 0.04;
    background-image: repeating-linear-gradient(
        -45deg, #ef4444 0px, #ef4444 2px, transparent 2px, transparent 60px
    );
}

/* Atmospheric blobs */
.auth-lockout-blob {
    position: fixed;
    border-radius: 999px;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    animation: auth-blob-float 8s ease-in-out infinite alternate;
}
@keyframes auth-blob-float {
    from { transform: translateY(0) scale(1); }
    to   { transform: translateY(-20px) scale(1.05); }
}

.auth-lockout-blob--a {
    width: 35vw; height: 35vw;
    top: -10%; right: -5%;
    opacity: 0.20;
}
.auth-lockout-blob--b {
    width: 25vw; height: 25vw;
    bottom: -8%; left: -3%;
    opacity: 0.15;
    animation-delay: -4s;
}

body.auth-page-lockout-perm .auth-lockout-blob { background: #ef4444; }
body.auth-page-lockout-temp .auth-lockout-blob { background: #f97316; }

/* Lockout card */
.auth-lockout-card {
    position: relative; z-index: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--auth-radius-xl);
    padding: 2.5rem 2rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 40px 80px -16px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.08);
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
}
.auth-lockout-card > * + * { margin-top: 1.75rem; }

/* Lockout symbol */
.auth-lockout-symbol {
    width: 6rem; height: 6rem;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
    position: relative;
}
.auth-lockout-symbol svg {
    width: 2.75rem; height: 2.75rem;
    stroke: currentColor; stroke-width: 2.5;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.auth-lockout-symbol--perm {
    background: rgba(239,68,68,0.15);
    border: 2px solid rgba(239,68,68,0.4);
    color: #fc8181;
    animation: auth-icon-beat 2s ease-in-out infinite;
}
.auth-lockout-symbol--temp {
    background: rgba(251,146,60,0.12);
    border: 2px solid rgba(251,146,60,0.35);
    color: #fdba74;
    animation: auth-icon-beat 2.5s ease-in-out infinite;
}
@keyframes auth-icon-beat {
    0%,100%{transform:scale(1);}
    50%{transform:scale(1.08);}
}
/* Pulse ring */
.auth-lockout-symbol::after {
    content: "";
    position: absolute;
    inset: -0.6rem;
    border-radius: 999px;
    border: 2px solid currentColor;
    opacity: 0;
    animation: auth-pulse-ring 2.5s ease-out infinite;
}
@keyframes auth-pulse-ring {
    0%  { opacity: 0.5; transform: scale(0.85); }
    70% { opacity: 0;   transform: scale(1.2); }
    100%{ opacity: 0;   transform: scale(1.2); }
}

/* Lockout heading */
.auth-lockout-heading { text-align: center; }
.auth-lockout-heading > * + * { margin-top: 0.5rem; }

.auth-lockout-kicker {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--auth-font-heading);
}
body.auth-page-lockout-perm .auth-lockout-kicker { color: #fc8181; }
body.auth-page-lockout-temp .auth-lockout-kicker { color: #fdba74; }

.auth-lockout-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 900;
    color: #f8fafc;
    font-family: var(--auth-font-heading);
    line-height: 1.25;
}

.auth-lockout-copy {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.75;
    color: rgba(248,250,252,0.65);
}

/* ── Countdown timer ── */
.auth-lockout-timer {
    border-radius: var(--auth-radius-md);
    padding: 1.5rem 1.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
body.auth-page-lockout-perm .auth-lockout-timer {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
}
body.auth-page-lockout-temp .auth-lockout-timer {
    background: rgba(251,146,60,0.12);
    border: 1px solid rgba(251,146,60,0.25);
}
.auth-lockout-timer > * + * { margin-top: 0.75rem; }

.auth-lockout-timer-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--auth-font-heading);
    color: rgba(248,250,252,0.5);
}

.auth-lockout-clock {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1;
    color: #f8fafc;
    text-shadow: 0 0 30px currentColor;
}
body.auth-page-lockout-perm .auth-lockout-clock { color: #fca5a5; text-shadow: 0 0 30px rgba(239,68,68,0.6); }
body.auth-page-lockout-temp .auth-lockout-clock { color: #fdba74; text-shadow: 0 0 30px rgba(251,146,60,0.6); }

.auth-lockout-timer-sublabel {
    font-size: 0.72rem;
    color: rgba(248,250,252,0.4);
    letter-spacing: 0.04em;
}

/* Progress bar */
.auth-progress {
    width: 100%; height: 0.5rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.auth-progress__bar {
    height: 100%; border-radius: 999px;
    transition: width 1s linear, background 0.4s;
}
body.auth-page-lockout-perm .auth-progress__bar {
    background: linear-gradient(90deg, #ef4444, #f97316);
    box-shadow: 0 0 10px rgba(239,68,68,0.5);
}
body.auth-page-lockout-temp .auth-progress__bar {
    background: linear-gradient(90deg, #f97316, #fbbf24);
    box-shadow: 0 0 10px rgba(251,146,60,0.5);
}
.auth-progress__bar.is-complete {
    background: linear-gradient(90deg, #22c55e, #10b981) !important;
    box-shadow: 0 0 12px rgba(34,197,94,0.6) !important;
}

/* Permanent static block */
.auth-lockout-perm-status {
    border-radius: var(--auth-radius-md);
    border: 1px solid rgba(239,68,68,0.25);
    background: rgba(239,68,68,0.10);
    padding: 1.25rem;
    text-align: center;
    color: #fca5a5;
}
.auth-lockout-perm-status p { margin: 0; font-size: 0.9rem; font-weight: 800; letter-spacing: 0.04em; }
.auth-lockout-perm-status .auth-lockout-perm-label {
    font-size: 0.7rem; color: rgba(252,161,161,0.6);
    letter-spacing: 0.1em; text-transform: uppercase;
    margin-bottom: 0.5rem !important;
    font-family: var(--auth-font-heading);
}

/* Info subcard inside lockout */
.auth-lockout-info {
    border-radius: var(--auth-radius-md);
    padding: 1rem 1.125rem;
    font-size: 0.85rem;
    line-height: 1.7;
    border: 1px solid;
}
.auth-lockout-info--perm {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.2);
    color: rgba(252,161,161,0.9);
}
.auth-lockout-info--temp {
    background: rgba(251,146,60,0.08);
    border-color: rgba(251,146,60,0.2);
    color: rgba(253,186,116,0.9);
}

/* Meta grid */
.auth-lockout-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
.auth-lockout-meta-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--auth-radius-sm);
    padding: 0.75rem 0.875rem;
    text-align: center;
}
.auth-lockout-meta-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(248,250,252,0.4);
    margin-bottom: 0.35rem;
    font-family: var(--auth-font-heading);
}
.auth-lockout-meta-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    color: #f8fafc;
}

/* Lockout action buttons */
.auth-lockout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.auth-lockout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: var(--auth-radius-sm);
    font-size: 0.85rem;
    font-weight: 800;
    font-family: var(--auth-font-heading);
    padding: 0.75rem 1rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: 1.5px solid;
}
.auth-lockout-btn svg {
    width: 0.9rem; height: 0.9rem;
    stroke: currentColor; stroke-width: 2.5;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}

.auth-lockout-btn--primary {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.20);
    color: #f8fafc;
}
body.auth-page-lockout-perm .auth-lockout-btn--accent {
    background: rgba(239,68,68,0.20);
    border-color: rgba(239,68,68,0.40);
    color: #fca5a5;
}
body.auth-page-lockout-temp .auth-lockout-btn--accent {
    background: rgba(251,146,60,0.18);
    border-color: rgba(251,146,60,0.35);
    color: #fdba74;
}
.auth-lockout-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
    .auth-login-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        min-height: auto;
    }
    .auth-brand-panel { min-height: 220px; padding: 2rem 1.75rem; }
    .auth-login-card  { padding: 2rem 1.75rem; }
    .auth-lockout-meta { grid-template-columns: repeat(3, 1fr); }
    .auth-lockout-clock { font-size: 2.75rem; }
}

@media (max-width: 480px) {
    .auth-brand-panel { display: none; }
    .auth-login-grid { border-radius: var(--auth-radius-lg); }
    .auth-login-card { border-radius: var(--auth-radius-lg); }
    .auth-lockout-actions { grid-template-columns: 1fr; }
    .auth-lockout-meta { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 640px) {
    .auth-inline-actions {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
    }
    .auth-actions--split { flex-direction: row; }
    .auth-actions--split > * { flex: 1 1 0; }
    .auth-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   Auth Layout Overrides v3
   Stable split-card layout for login and lockout across browsers
   ============================================================ */

body.auth-security-body {
    min-height: 100dvh;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-shell,
.auth-lockout-shell {
    min-height: 100dvh;
    min-height: 100vh;
}

.auth-login-card,
.auth-brand-panel,
.auth-lockout-hero,
.auth-lockout-card {
    min-width: 0;
}

body.auth-page-login .auth-shell--wide,
body.auth-page-lockout-temp .auth-shell--wide,
body.auth-page-lockout-perm .auth-shell--wide {
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.auth-page-login .auth-login-grid,
body.auth-page-lockout-temp .auth-login-grid--lockout,
body.auth-page-lockout-perm .auth-login-grid--lockout {
    width: min(1120px, 100%);
    max-width: 1120px;
    min-height: min(740px, calc(100vh - clamp(2rem, 6vw, 5rem)));
    grid-template-columns: minmax(0, 0.98fr) minmax(0, 1.02fr);
    border-radius: 2rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.18);
    box-shadow:
        0 40px 90px -38px rgba(2, 8, 23, 0.68),
        0 18px 46px -28px rgba(15, 23, 42, 0.44);
    backdrop-filter: blur(14px);
    isolation: isolate;
}

body.auth-page-login .auth-login-card,
body.auth-page-lockout-temp .auth-lockout-panel,
body.auth-page-lockout-perm .auth-lockout-panel {
    grid-column: 1;
    grid-row: 1;
    min-height: 100%;
    padding: clamp(2rem, 4vw, 3.4rem);
    background: rgba(255, 255, 255, 0.985);
    overflow: auto;
    color: var(--auth-text);
}

body.auth-page-login .auth-brand-panel,
body.auth-page-lockout-temp .auth-brand-panel,
body.auth-page-lockout-perm .auth-brand-panel {
    grid-column: 2;
    grid-row: 1;
    min-height: 100%;
    padding: clamp(2rem, 4vw, 3.4rem);
    justify-content: space-between;
}

body.auth-page-login .auth-brand-panel::before,
body.auth-page-lockout-temp .auth-brand-panel::before,
body.auth-page-lockout-perm .auth-brand-panel::before {
    top: -4.5rem;
    right: -3rem;
    width: clamp(11rem, 24vw, 16rem);
    height: clamp(11rem, 24vw, 16rem);
}

body.auth-page-login .auth-brand-panel::after,
body.auth-page-lockout-temp .auth-brand-panel::after,
body.auth-page-lockout-perm .auth-brand-panel::after {
    bottom: -4rem;
    left: -3rem;
    width: clamp(10rem, 22vw, 14rem);
    height: clamp(10rem, 22vw, 14rem);
}

body.auth-page-login .auth-topbar,
body.auth-page-lockout-temp .auth-topbar,
body.auth-page-lockout-perm .auth-topbar {
    gap: 1rem;
    margin-bottom: 1.75rem;
}

body.auth-page-login .auth-heading,
body.auth-page-lockout-temp .auth-heading,
body.auth-page-lockout-perm .auth-heading {
    flex: 1 1 auto;
}

body.auth-page-login .auth-title,
body.auth-page-lockout-temp .auth-title,
body.auth-page-lockout-perm .auth-title {
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

body.auth-page-login .auth-copy,
body.auth-page-lockout-temp .auth-copy,
body.auth-page-lockout-perm .auth-copy {
    font-size: 1rem;
    line-height: 1.8;
}

body.auth-page-login .auth-brand-top,
body.auth-page-lockout-temp .auth-brand-top,
body.auth-page-lockout-perm .auth-brand-top {
    gap: 1.4rem;
}

body.auth-page-login .auth-brand-title,
body.auth-page-lockout-temp .auth-brand-title,
body.auth-page-lockout-perm .auth-brand-title {
    font-size: clamp(2.35rem, 3.4vw, 3.55rem);
    font-weight: 900;
    line-height: 1.04;
}

body.auth-page-login .auth-brand-copy,
body.auth-page-lockout-temp .auth-brand-copy,
body.auth-page-lockout-perm .auth-brand-copy {
    font-size: 1rem;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.8);
}

body.auth-page-login .auth-brand-badge,
body.auth-page-lockout-temp .auth-brand-badge,
body.auth-page-lockout-perm .auth-brand-badge {
    width: 4.8rem;
    height: 4.8rem;
    border-radius: 1.35rem;
    box-shadow: 0 20px 32px -24px rgba(15, 23, 42, 0.7);
}

body.auth-page-login .auth-brand-badges,
body.auth-page-lockout-temp .auth-brand-badges,
body.auth-page-lockout-perm .auth-brand-badges {
    gap: 0.65rem;
    margin-top: 0.4rem;
}

body.auth-page-login .auth-brand-badge-pill,
body.auth-page-lockout-temp .auth-brand-badge-pill,
body.auth-page-lockout-perm .auth-brand-badge-pill {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
}

body.auth-page-login .auth-brand-quote,
body.auth-page-lockout-temp .auth-brand-quote,
body.auth-page-lockout-perm .auth-brand-quote {
    border-radius: 1.3rem;
    padding: 1.35rem 1.4rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.auth-page-login .auth-message-stack,
body.auth-page-lockout-temp .auth-message-stack,
body.auth-page-lockout-perm .auth-message-stack {
    margin-bottom: 1rem;
}

.auth-alert__icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.auth-kicker--accent {
    color: var(--auth-accent) !important;
}

.auth-home-btn {
    width: auto;
    flex: none;
    min-height: 2.9rem;
    padding: 0.65rem 1rem;
    font-size: 0.84rem;
    white-space: nowrap;
    border-radius: 1rem;
}

body.auth-page-login .auth-form {
    gap: 1.1rem;
}

body.auth-page-login .auth-field,
body.auth-page-lockout-temp .auth-field,
body.auth-page-lockout-perm .auth-field {
    gap: 0.5rem;
}

body.auth-page-login .auth-label,
body.auth-page-lockout-temp .auth-label,
body.auth-page-lockout-perm .auth-label {
    font-size: 0.96rem;
    font-weight: 800;
    color: #334155;
}

body.auth-page-login .auth-input,
body.auth-page-login .auth-login-card input[type="text"],
body.auth-page-login .auth-login-card input[type="password"],
body.auth-page-login .auth-login-card input[type="email"],
body.auth-page-login .auth-login-card select,
body.auth-page-lockout-temp .auth-input,
body.auth-page-lockout-perm .auth-input {
    min-height: 3.75rem;
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
    border-color: #d8e3f8;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    border-radius: 1rem;
}

body.auth-page-login .auth-input:focus,
body.auth-page-login .auth-login-card input:focus,
body.auth-page-login .auth-login-card select:focus,
body.auth-page-lockout-temp .auth-input:focus,
body.auth-page-lockout-perm .auth-input:focus {
    background: #ffffff;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-login-card input:-webkit-autofill,
.auth-login-card input:-webkit-autofill:hover,
.auth-login-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a;
    caret-color: #0f172a;
    border: 1.5px solid #d8e3f8;
    box-shadow: 0 0 0 1000px #eef4ff inset;
    transition: background-color 9999s ease-out 0s;
}

.auth-input:autofill,
.auth-login-card input:autofill {
    box-shadow: 0 0 0 1000px #eef4ff inset;
}

body.auth-page-login .auth-field-icon,
body.auth-page-login .auth-field-toggle {
    color: #94a3b8;
}

body.auth-page-login .auth-inline-actions {
    gap: 0.75rem;
    margin-top: 0.15rem;
}

body.auth-page-login .auth-btn,
body.auth-page-lockout-temp .auth-btn,
body.auth-page-lockout-perm .auth-btn,
body.auth-page-login .auth-link-btn,
body.auth-page-lockout-temp .auth-link-btn,
body.auth-page-lockout-perm .auth-link-btn {
    min-height: 3.55rem;
    border-radius: 1rem;
}

body.auth-page-login .auth-btn--accent,
body.auth-page-lockout-temp .auth-btn--accent,
body.auth-page-lockout-perm .auth-btn--accent {
    box-shadow: 0 18px 38px -24px var(--auth-accent-glow);
}

body.auth-page-login .auth-btn--accent:hover:not(:disabled),
body.auth-page-lockout-temp .auth-btn--accent:hover:not(:disabled),
body.auth-page-lockout-perm .auth-btn--accent:hover:not(:disabled) {
    transform: translateY(-1px);
}

body.auth-page-lockout-temp .auth-lockout-panel,
body.auth-page-lockout-perm .auth-lockout-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

body.auth-page-lockout-temp .auth-topbar--stack,
body.auth-page-lockout-perm .auth-topbar--stack {
    align-items: flex-start;
}

.auth-copy--compact {
    font-size: 0.92rem;
    color: var(--auth-text-soft);
}

.auth-lockout-timer-card,
.auth-lockout-perm-card {
    border-radius: 1.35rem;
    padding: 1.4rem;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

body.auth-page-lockout-temp .auth-lockout-timer-card {
    border-color: #fdba74;
    background: linear-gradient(180deg, #fff7ed 0%, #fffaf5 100%);
}

body.auth-page-lockout-perm .auth-lockout-perm-card {
    border-color: #fda4af;
    background: linear-gradient(180deg, #fff1f2 0%, #fff7f7 100%);
}

body.auth-page-lockout-temp .auth-lockout-timer-label,
body.auth-page-lockout-perm .auth-lockout-perm-label {
    color: #9a3412;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0.03em;
}

body.auth-page-lockout-perm .auth-lockout-perm-label {
    color: #be123c;
}

body.auth-page-lockout-temp .auth-lockout-clock,
body.auth-page-lockout-perm .auth-lockout-clock {
    font-size: clamp(2.6rem, 5vw, 3.8rem);
    line-height: 1;
    text-shadow: none;
}

body.auth-page-lockout-temp .auth-lockout-clock {
    color: #c2410c;
}

body.auth-page-lockout-perm .auth-lockout-perm-copy,
body.auth-page-lockout-perm .auth-lockout-clock {
    color: #be123c;
}

body.auth-page-lockout-temp .auth-progress,
body.auth-page-lockout-perm .auth-progress {
    height: 0.65rem;
    background: rgba(148, 163, 184, 0.2);
}

body.auth-page-lockout-temp .auth-progress__bar {
    background: linear-gradient(90deg, #f97316 0%, #facc15 100%);
    box-shadow: 0 10px 24px -12px rgba(249, 115, 22, 0.72);
}

body.auth-page-lockout-perm .auth-progress__bar {
    background: linear-gradient(90deg, #fb7185 0%, #ef4444 100%);
    box-shadow: 0 10px 24px -12px rgba(239, 68, 68, 0.72);
}

.auth-lockout-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.auth-lockout-metric {
    border-radius: 1.1rem;
    padding: 1rem 0.95rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    text-align: center;
}

.auth-lockout-metric-label {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.auth-lockout-metric-value {
    display: block;
    font-size: 1rem;
    color: #0f172a;
}

body.auth-page-lockout-temp .auth-subcard--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

body.auth-page-lockout-perm .auth-subcard--danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

@media (max-width: 980px) {
    body.auth-page-login .auth-shell--wide,
    body.auth-page-lockout-temp .auth-shell--wide,
    body.auth-page-lockout-perm .auth-shell--wide {
        padding: 1rem;
        align-items: stretch;
    }

    body.auth-page-login .auth-login-grid,
    body.auth-page-lockout-temp .auth-login-grid--lockout,
    body.auth-page-lockout-perm .auth-login-grid--lockout {
        min-height: auto;
        grid-template-columns: 1fr;
        border-radius: 1.6rem;
    }

    body.auth-page-login .auth-login-card,
    body.auth-page-lockout-temp .auth-lockout-panel,
    body.auth-page-lockout-perm .auth-lockout-panel,
    body.auth-page-login .auth-brand-panel,
    body.auth-page-lockout-temp .auth-brand-panel,
    body.auth-page-lockout-perm .auth-brand-panel {
        grid-column: 1;
        min-height: auto;
    }

    body.auth-page-login .auth-login-card,
    body.auth-page-lockout-temp .auth-lockout-panel,
    body.auth-page-lockout-perm .auth-lockout-panel {
        order: 1;
        justify-content: flex-start;
    }

    body.auth-page-login .auth-brand-panel,
    body.auth-page-lockout-temp .auth-brand-panel,
    body.auth-page-lockout-perm .auth-brand-panel {
        order: 2;
        display: flex;
        min-height: 19rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 640px) {
    body.auth-page-login .auth-title,
    body.auth-page-lockout-temp .auth-title,
    body.auth-page-lockout-perm .auth-title {
        font-size: 2rem;
    }

    body.auth-page-login .auth-topbar,
    body.auth-page-lockout-temp .auth-topbar,
    body.auth-page-lockout-perm .auth-topbar {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .auth-home-btn {
        width: 100%;
    }

    body.auth-page-login .auth-inline-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    body.auth-page-login .auth-brand-panel {
        min-height: 15rem;
    }

    body.auth-page-login .auth-brand-quote {
        display: none;
    }

    body.auth-page-login .auth-brand-badges {
        display: grid;
        grid-template-columns: 1fr;
    }

    .auth-modal {
        padding: 0.75rem;
    }

    .auth-modal__header,
    .auth-modal__body,
    .auth-modal__footer {
        padding: 1rem;
    }

    .auth-lockout-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    body.auth-page-login .auth-shell--wide,
    body.auth-page-lockout-temp .auth-shell--wide,
    body.auth-page-lockout-perm .auth-shell--wide {
        padding: 0.75rem;
    }

    body.auth-page-login .auth-login-card,
    body.auth-page-lockout-temp .auth-lockout-panel,
    body.auth-page-lockout-perm .auth-lockout-panel,
    body.auth-page-login .auth-brand-panel,
    body.auth-page-lockout-temp .auth-brand-panel,
    body.auth-page-lockout-perm .auth-brand-panel {
        padding: 1.35rem;
    }

    body.auth-page-login .auth-brand-badges,
    body.auth-page-lockout-temp .auth-brand-badges,
    body.auth-page-lockout-perm .auth-brand-badges {
        gap: 0.45rem;
    }

    body.auth-page-login .auth-input,
    body.auth-page-login .auth-login-card input[type="text"],
    body.auth-page-login .auth-login-card input[type="password"],
    body.auth-page-login .auth-login-card input[type="email"],
    body.auth-page-login .auth-login-card select,
    body.auth-page-lockout-temp .auth-input,
    body.auth-page-lockout-perm .auth-input {
        min-height: 3.2rem;
        font-size: 0.92rem;
    }

    body.auth-page-login .auth-btn,
    body.auth-page-lockout-temp .auth-btn,
    body.auth-page-lockout-perm .auth-btn,
    body.auth-page-login .auth-link-btn,
    body.auth-page-lockout-temp .auth-link-btn,
    body.auth-page-lockout-perm .auth-link-btn {
        min-height: 3.1rem;
    }

    .auth-lockout-metrics {
        grid-template-columns: 1fr;
    }

    .auth-actions--split {
        flex-direction: column;
    }
}

@media (max-width: 980px) {
    html,
    body.auth-page-login,
    body.auth-page-lockout-temp,
    body.auth-page-lockout-perm {
        min-height: 100%;
        min-height: 100dvh;
    }

    body.auth-page-login,
    body.auth-page-lockout-temp,
    body.auth-page-lockout-perm {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.auth-page-login .auth-shell,
    .auth-lockout-shell {
        min-height: 100dvh;
        align-items: flex-start;
    }

    body.auth-page-login .auth-shell--wide {
        width: 100%;
        min-height: 100dvh;
        padding: max(0.85rem, env(safe-area-inset-top)) 0.85rem max(1rem, env(safe-area-inset-bottom));
        align-items: flex-start;
    }

    body.auth-page-login .auth-login-grid {
        width: 100%;
        min-height: auto;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        overflow: visible;
        border-radius: 1.5rem;
    }

    body.auth-page-login .auth-brand-panel {
        display: none;
    }

    body.auth-page-login .auth-login-card {
        min-height: auto;
        max-height: none;
        overflow: visible;
        border-radius: 1.5rem;
        padding: 1.35rem;
        box-shadow: 0 24px 60px -36px rgba(15, 23, 42, 0.38);
    }

    body.auth-page-login .auth-form,
    body.auth-page-login .auth-field,
    body.auth-page-login .auth-field-wrap,
    body.auth-page-login .auth-topbar,
    body.auth-page-login .auth-heading {
        min-width: 0;
    }

    body.auth-page-login .auth-input,
    body.auth-page-login .auth-login-card input[type="text"],
    body.auth-page-login .auth-login-card input[type="password"],
    body.auth-page-login .auth-login-card input[type="email"],
    body.auth-page-login .auth-login-card input[type="search"],
    body.auth-page-login .auth-login-card select,
    body.auth-page-login .auth-login-card textarea {
        font-size: 16px;
        line-height: 1.45;
        min-height: 3.25rem;
    }

    body.auth-page-login .auth-field-toggle {
        min-width: 2.9rem;
        min-height: 2.9rem;
    }

    body.auth-page-login .auth-message-stack,
    body.auth-page-login .auth-alert,
    body.auth-page-login .auth-subcard {
        max-width: 100%;
    }

    .auth-modal {
        align-items: flex-start;
        padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.9rem, env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    .auth-modal__dialog,
    .auth-modal__panel {
        width: 100%;
        max-width: 100%;
    }

    .auth-modal__panel {
        max-height: calc(100dvh - 1.5rem);
        overflow-y: auto;
    }

    .auth-lockout-shell {
        padding: max(0.9rem, env(safe-area-inset-top)) 0.9rem max(1rem, env(safe-area-inset-bottom));
    }

    .auth-lockout-layout {
        width: 100%;
        margin: 0;
    }

    .auth-lockout-card {
        max-height: none;
    }
}

@media (max-width: 640px) {
    body.auth-page-login .auth-shell--wide {
        padding: max(0.7rem, env(safe-area-inset-top)) 0.7rem max(0.9rem, env(safe-area-inset-bottom));
    }

    body.auth-page-login .auth-login-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.auth-page-login .auth-login-card {
        padding: 1.1rem;
        border-radius: 1.25rem;
        width: 100%;
    }

    body.auth-page-login .auth-login-grid {
        border-radius: 1.25rem;
    }

    body.auth-page-login .auth-title {
        font-size: 1.8rem;
    }

    body.auth-page-login .auth-copy {
        font-size: 0.9rem;
    }

    body.auth-page-login .auth-topbar {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0.75rem;
    }

    body.auth-page-login .auth-home-btn,
    body.auth-page-login .auth-link-inline,
    body.auth-page-login .auth-checkbox {
        width: 100%;
    }

    body.auth-page-login .auth-home-btn,
    body.auth-page-login .auth-link-inline {
        justify-content: center;
        text-align: center;
    }

    body.auth-page-login .auth-inline-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    body.auth-page-login .auth-checkbox {
        justify-content: space-between;
    }

    body.auth-page-login .auth-field-wrap {
        min-height: 3.25rem;
    }

    body.auth-page-login .auth-field-icon {
        inset-inline-start: 0.9rem;
    }

    .auth-lockout-shell {
        min-height: 100dvh;
        align-items: flex-start;
    }

    .auth-lockout-hero,
    .auth-lockout-card {
        border-radius: 1.2rem;
    }

    .auth-lockout-clock {
        font-size: clamp(2rem, 11vw, 3rem);
    }
}

@media (max-width: 420px) {
    body.auth-page-login .auth-login-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.auth-page-login .auth-login-card {
        padding: 1rem;
    }

    body.auth-page-login .auth-topbar {
        margin-bottom: 1rem;
    }

    body.auth-page-login .auth-title {
        font-size: 1.55rem;
    }

    body.auth-page-login .auth-copy,
    body.auth-page-login .auth-kicker,
    body.auth-page-login .auth-label {
        word-break: break-word;
    }

    body.auth-page-login .auth-input,
    body.auth-page-login .auth-login-card input[type="text"],
    body.auth-page-login .auth-login-card input[type="password"],
    body.auth-page-login .auth-login-card input[type="email"],
    body.auth-page-login .auth-login-card input[type="search"],
    body.auth-page-login .auth-login-card select,
    body.auth-page-login .auth-login-card textarea {
        font-size: 16px;
        min-height: 3.15rem;
    }
}

/* ============================================================
   Dark Mode — security pages that aren't login/lockout
   (reauth, MFA entry, device-review, etc.)
   ============================================================ */

html.dark body.auth-security-body:not(.auth-page-login):not(.auth-page-lockout-temp):not(.auth-page-lockout-perm) {
    background:
        radial-gradient(ellipse at 16% 42%, rgba(13,148,136,0.06) 0%, transparent 56%),
        radial-gradient(ellipse at 84% 16%, rgba(14,165,233,0.06) 0%, transparent 42%),
        linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
}

html.dark .auth-card {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.18);
    color: #f1f5f9;
}

html.dark .auth-title { color: #f1f5f9; }
html.dark .auth-copy  { color: #94a3b8; }
html.dark .auth-label { color: #cbd5e1; }

/* Light-mode default and reauth/MFA pages (kept for backwards compatibility) */
html.dark .auth-input,
html.dark .auth-card input[type="text"],
html.dark .auth-card input[type="password"],
html.dark .auth-card input[type="email"],
html.dark .auth-card select {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.22);
    color: #f1f5f9;
}
html.dark .auth-input::placeholder,
html.dark .auth-card input::placeholder { color: #64748b; }
html.dark .auth-input:focus,
html.dark .auth-card input:focus,
html.dark .auth-card select:focus {
    background: #1e293b;
    border-color: var(--auth-accent);
}

/* Login / lockout pages — these have higher-specificity light-mode rules
   under `body.auth-page-login` (line ~1339 onwards) that paint the inputs
   with a light-blue gradient. To override them in dark mode we must match
   their specificity by including the body class. !important on color/bg
   guards against the !inside-media-query overrides further down the file. */
html.dark body.auth-page-login .auth-input,
html.dark body.auth-page-login .auth-login-card input[type="text"],
html.dark body.auth-page-login .auth-login-card input[type="password"],
html.dark body.auth-page-login .auth-login-card input[type="email"],
html.dark body.auth-page-login .auth-login-card input[type="search"],
html.dark body.auth-page-login .auth-login-card select,
html.dark body.auth-page-login .auth-login-card textarea,
html.dark body.auth-page-lockout-temp .auth-input,
html.dark body.auth-page-lockout-perm .auth-input {
    background: #0f172a !important;
    background-image: none !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: #f1f5f9 !important;
    caret-color: #f1f5f9 !important;
}
html.dark body.auth-page-login .auth-input::placeholder,
html.dark body.auth-page-login .auth-login-card input::placeholder,
html.dark body.auth-page-login .auth-login-card textarea::placeholder {
    color: #94a3b8 !important;
}
html.dark body.auth-page-login .auth-input:focus,
html.dark body.auth-page-login .auth-login-card input:focus,
html.dark body.auth-page-login .auth-login-card select:focus,
html.dark body.auth-page-login .auth-login-card textarea:focus {
    background: #1e293b !important;
    border-color: var(--auth-accent) !important;
}
html.dark body.auth-page-login .auth-label,
html.dark body.auth-page-lockout-temp .auth-label,
html.dark body.auth-page-lockout-perm .auth-label {
    color: #e2e8f0;
}

/* Autofill on login/lockout pages — pin the dark surface so saved
   credentials don't paint over with browser yellow + invisible text. */
html.dark body.auth-page-login .auth-input:-webkit-autofill,
html.dark body.auth-page-login .auth-login-card input:-webkit-autofill,
html.dark body.auth-page-login .auth-login-card input:-webkit-autofill:hover,
html.dark body.auth-page-login .auth-login-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9 !important;
    -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important;
    caret-color: #f1f5f9 !important;
    border: 1.5px solid rgba(148, 163, 184, 0.28) !important;
}

html.dark .auth-btn--ghost,
html.dark .auth-link-btn--ghost {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}
html.dark .auth-btn--ghost:hover:not(:disabled),
html.dark .auth-link-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--auth-accent);
    color: var(--auth-accent);
}

html.dark .auth-alert--danger  { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.25); color: #fca5a5; }
html.dark .auth-alert--warning { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.25); color: #fde68a; }
html.dark .auth-alert--success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.25); color: #6ee7b7; }
html.dark .auth-alert--info    { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.25); color: #93c5fd; }

html.dark .auth-status--danger  { color: #fca5a5; }
html.dark .auth-status--success { color: #6ee7b7; }

html.dark .auth-steps .auth-step {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.15);
}
html.dark .auth-steps .auth-step__title { color: #f1f5f9; }
html.dark .auth-steps .auth-step__copy  { color: #94a3b8; }

html.dark .auth-tabs {
    background: rgba(7, 17, 31, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
}
html.dark .auth-tab {
    color: #64748b;
}
html.dark .auth-tab:hover {
    color: var(--auth-accent);
}
html.dark .auth-tab.is-active {
    background: #1e293b;
    color: var(--auth-accent);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

html.dark .auth-subcard--info    { background: rgba(59,130,246,0.12);  border-color: rgba(59,130,246,0.24);  color: #93c5fd; }
html.dark .auth-subcard--warning { background: rgba(245,158,11,0.12);  border-color: rgba(245,158,11,0.24);  color: #fde68a; }
html.dark .auth-subcard--danger  { background: rgba(239,68,68,0.12);   border-color: rgba(239,68,68,0.24);   color: #fca5a5; }
html.dark .auth-subcard--success { background: rgba(16,185,129,0.12);  border-color: rgba(16,185,129,0.24);  color: #6ee7b7; }
html.dark .auth-subcard--info .auth-subtitle,
html.dark .auth-subcard--warning .auth-subtitle,
html.dark .auth-subcard--danger  .auth-subtitle,
html.dark .auth-subcard--success .auth-subtitle { color: inherit; }

/* ============================================================
   Lockout Standalone v5
   Separate and explicit from the login experience
   ============================================================ */

.auth-lockout-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 2.25rem);
}

.auth-lockout-layout {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 1.15rem;
    align-items: stretch;
}

.auth-lockout-hero,
.auth-lockout-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.85rem;
}

.auth-lockout-hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    padding: clamp(1.55rem, 3.5vw, 2.45rem);
    color: #ffffff;
    background:
        radial-gradient(circle at 84% 16%, rgba(255, 255, 255, 0.14), transparent 26%),
        radial-gradient(circle at 14% 100%, rgba(255, 255, 255, 0.08), transparent 28%),
        linear-gradient(135deg, #1d4ed8 0%, #4338ca 48%, #0f172a 100%);
    box-shadow: 0 30px 60px -36px rgba(15, 23, 42, 0.76);
}

body.auth-page-lockout-perm .auth-lockout-hero {
    background:
        radial-gradient(circle at 84% 16%, rgba(255, 255, 255, 0.12), transparent 26%),
        radial-gradient(circle at 14% 100%, rgba(255, 255, 255, 0.07), transparent 28%),
        linear-gradient(135deg, #7f1d1d 0%, #4c0519 54%, #111827 100%);
}

.auth-lockout-hero-top {
    display: grid;
    gap: 1.1rem;
}

.auth-lockout-icon-wrap {
    width: 5.2rem;
    height: 5.2rem;
    border-radius: 1.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-lockout-icon-wrap svg {
    width: 2.2rem;
    height: 2.2rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.auth-lockout-hero-copyblock {
    max-width: 34rem;
}

.auth-lockout-hero-title {
    margin: 0;
    font-family: var(--auth-font-heading);
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.auth-lockout-hero-copy {
    margin: 0.9rem 0 0;
    font-size: 1rem;
    line-height: 1.95;
    color: rgba(255, 255, 255, 0.86);
}

.auth-lockout-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.4rem;
}

.auth-lockout-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.48rem 0.92rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.82rem;
    font-weight: 800;
    font-family: var(--auth-font-heading);
}

.auth-lockout-highlight {
    margin-top: 1.45rem;
    padding: 1.05rem 1.1rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-lockout-highlight strong {
    display: block;
    margin: 0;
    font-size: 1rem;
    font-family: var(--auth-font-heading);
    font-weight: 900;
}

.auth-lockout-highlight p {
    margin: 0.45rem 0 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.8;
    font-size: 0.95rem;
}

.auth-lockout-card {
    display: grid;
    gap: 1rem;
    align-content: start;
    background: rgba(255, 255, 255, 0.985);
    padding: clamp(1.35rem, 2.8vw, 1.9rem);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 28px 56px -36px rgba(15, 23, 42, 0.5);
}

.auth-lockout-card .auth-alert,
.auth-lockout-card .auth-subcard {
    margin: 0;
}

.auth-lockout-card .auth-actions--split {
    margin-top: 0.2rem;
}

body.auth-page-lockout-temp .auth-lockout-card .auth-btn--accent {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-color: #f97316;
    box-shadow: 0 18px 34px -24px rgba(249, 115, 22, 0.62);
}

body.auth-page-lockout-perm .auth-lockout-card .auth-btn--accent {
    background: linear-gradient(135deg, #ef4444 0%, #be123c 100%);
    border-color: #ef4444;
    box-shadow: 0 18px 34px -24px rgba(239, 68, 68, 0.62);
}

@media (max-width: 900px) {
    .auth-lockout-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .auth-lockout-shell {
        padding: 0.85rem;
    }

    .auth-lockout-layout {
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.85rem;
    }

    .auth-lockout-hero,
    .auth-lockout-card {
        border-radius: 1.35rem;
        padding: 1.2rem;
    }

    .auth-lockout-icon-wrap {
        width: 4.5rem;
        height: 4.5rem;
        border-radius: 1.25rem;
    }

    .auth-lockout-chip {
        width: 100%;
        justify-content: flex-start;
    }

    .auth-lockout-highlight {
        padding: 0.95rem 1rem;
    }
}

/* ============================================================
   DEMO CREDENTIALS PANEL
   Only rendered when MEDMAX_DEMO_MODE=True
   ============================================================ */
.demo-credentials-panel {
    margin-top: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(168,85,247,0.06) 100%);
    border: 1px solid rgba(99,102,241,0.15);
    padding: 20px;
    animation: demoFadeIn 0.5s ease-out;
}
@keyframes demoFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.demo-panel-header { text-align: center; margin-bottom: 16px; }
.demo-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}
.demo-badge-pill svg { flex-shrink: 0; }
.demo-panel-subtitle {
    font-size: 12px;
    color: var(--auth-text-muted, #64748b);
    line-height: 1.5;
}
.demo-accounts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
@media (max-width: 500px) {
    .demo-accounts-grid { grid-template-columns: 1fr; }
}
.demo-account-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.06);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: start;
    font-family: inherit;
    font-size: inherit;
}
.dark .demo-account-card {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}
.demo-account-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
    transform: translateY(-1px);
}
.demo-account-card:active { transform: scale(0.98); }
.demo-account-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.demo-account-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.demo-account-role {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}
.dark .demo-account-role { color: #e2e8f0; }
.demo-account-role-en {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    opacity: 0.8;
}
.demo-panel-footer {
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.dark .demo-panel-footer { border-top-color: rgba(255,255,255,0.08); }
.demo-panel-footer p {
    font-size: 12px;
    color: var(--auth-text-muted, #64748b);
    margin: 0;
}
.demo-panel-footer code {
    background: rgba(99,102,241,0.1);
    color: #6366f1;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.demo-disclaimer {
    margin-top: 6px !important;
    font-size: 11px !important;
    color: #94a3b8 !important;
    font-style: italic;
}
/* Per-role accent colors */
.demo-color-admin       { --accent: #dc2626; }
.demo-color-doctor      { --accent: #059669; }
.demo-color-nurse       { --accent: #ec4899; }
.demo-color-receptionist{ --accent: #8b5cf6; }
.demo-color-labtech     { --accent: #f59e0b; }
.demo-color-pharmacist  { --accent: #06b6d4; }
.demo-color-accountant  { --accent: #84cc16; }
.demo-color-patient     { --accent: #6366f1; }

/* ============================================================
   DEMO MASK PILLS (IP redaction + locked action chips)
   Only emitted when MEDMAX_DEMO_MODE=True.
   Visible by design — visitors should KNOW the value is hidden.
   ============================================================ */
.demo-mask-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px 2px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(168,85,247,0.10));
    border: 1px dashed rgba(99,102,241,0.45);
    color: #6366f1;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.4;
    direction: rtl;
}
.dark .demo-mask-pill {
    background: linear-gradient(135deg, rgba(129,140,248,0.20), rgba(192,132,252,0.20));
    border-color: rgba(129,140,248,0.55);
    color: #c4b5fd;
}
.demo-mask-pill__icon { font-size: 12px; line-height: 1; }
.demo-mask-pill__text { font-size: 11px; line-height: 1; }
html[lang="en"] .demo-mask-pill { direction: ltr; }

/* Locked action chip — replaces a button that's unsafe in demo */
.demo-locked-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    background: repeating-linear-gradient(45deg,
        rgba(148,163,184,0.10), rgba(148,163,184,0.10) 6px,
        rgba(148,163,184,0.20) 6px, rgba(148,163,184,0.20) 12px);
    border: 1px solid rgba(148,163,184,0.35);
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    cursor: not-allowed;
    user-select: none;
    opacity: 0.85;
    vertical-align: middle;
    line-height: 1.3;
}
.dark .demo-locked-btn {
    background: repeating-linear-gradient(45deg,
        rgba(71,85,105,0.30), rgba(71,85,105,0.30) 6px,
        rgba(71,85,105,0.50) 6px, rgba(71,85,105,0.50) 12px);
    border-color: rgba(148,163,184,0.45);
    color: #cbd5e1;
}
.demo-locked-btn:hover {
    background: repeating-linear-gradient(45deg,
        rgba(99,102,241,0.10), rgba(99,102,241,0.10) 6px,
        rgba(99,102,241,0.20) 6px, rgba(99,102,241,0.20) 12px);
    border-color: rgba(99,102,241,0.45);
}
.demo-locked-btn__icon { font-size: 13px; line-height: 1; }
.demo-locked-btn__text { font-size: 12px; line-height: 1.3; }

/* Section-level demo banner (above forms) */
.demo-locked-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    margin: 8px 0 14px;
    background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(244,114,182,0.08));
    border: 1px solid rgba(245,158,11,0.30);
    color: #92400e;
    font-size: 13px;
    line-height: 1.55;
}
.dark .demo-locked-banner {
    background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(244,114,182,0.18));
    border-color: rgba(245,158,11,0.50);
    color: #fcd34d;
}
.demo-locked-banner__icon {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1.4;
}
.demo-locked-banner__body { flex: 1; min-width: 0; }
.demo-locked-banner__title { font-weight: 800; margin-bottom: 2px; }
.demo-locked-banner__text { font-weight: 500; opacity: 0.9; }

/* ============================================================
   DEMO-LOCKED CARD / TILE / SIDEBAR ITEM
   Wrap any `<a>` or `<div>` that links to a page that is locked
   in demo mode. Gives the element a tasteful dimmed-with-lock
   feel — the user sees the entry exists but can't navigate to it.
   ============================================================ */
.demo-locked-card,
a.demo-locked-card,
.finance-workflow-card.demo-locked,
.demo-locked-tile {
    position: relative;
    filter: grayscale(0.65);
    opacity: 0.58;
    cursor: not-allowed !important;
    pointer-events: none;
    transition: opacity 0.18s ease, filter 0.18s ease;
}
.demo-locked-card:hover,
a.demo-locked-card:hover,
.finance-workflow-card.demo-locked:hover,
.demo-locked-tile:hover {
    opacity: 0.66;
    filter: grayscale(0.55);
}
/* Re-enable hover on the lock-badge overlay so its tooltip still works
   (we set pointer-events: auto on the badge below). */
.demo-card-lock-pill {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px 4px 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(99,102,241,0.95), rgba(168,85,247,0.95));
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 6px 16px rgba(99,102,241,0.30);
    pointer-events: auto;
    cursor: help;
    line-height: 1.3;
    backdrop-filter: blur(2px);
    white-space: nowrap;
}
.demo-card-lock-pill::before {
    content: '\1F512';
    font-size: 13px;
    line-height: 1;
}
.dark .demo-card-lock-pill {
    background: linear-gradient(135deg, rgba(129,140,248,0.95), rgba(192,132,252,0.95));
    box-shadow: 0 6px 18px rgba(129,140,248,0.35);
}
/* Sidebar nav item flavour — compact, doesn't break the line */
.demo-locked-nav {
    position: relative;
    opacity: 0.55;
    cursor: not-allowed !important;
    pointer-events: none;
    filter: grayscale(0.6);
}
.demo-locked-nav .demo-nav-lock {
    display: inline-flex;
    align-items: center;
    padding: 0 5px;
    margin-inline-start: 6px;
    border-radius: 8px;
    background: rgba(99,102,241,0.18);
    color: #6366f1;
    font-size: 10px;
    font-weight: 800;
    pointer-events: auto;
}
.dark .demo-locked-nav .demo-nav-lock {
    background: rgba(129,140,248,0.25);
    color: #c4b5fd;
}

