/**
 * LabPulse Auth Layout
 * -----------------------------------------------------------------
 * Two-panel chrome for unauthenticated pages (login, change password):
 * a navy Dr. Yanga's Colleges branding panel beside the actual form
 * panel, styled as one cohesive card. Reuses design tokens + component
 * classes (.btn, .field, .input, .alert) from the main stylesheet -
 * this file only adds the page-level frame around them, so it's loaded
 * in addition to style.css, not instead of it.
 * -----------------------------------------------------------------
 */

/* Features #46-54: same navy/gold ground + faint laboratory grid as the
   public homepage hero, a top bar back to the homepage, and the card
   sized to the form (never stretched). Fixed-dark on purpose in both
   themes - the form panel itself still follows the theme tokens. */
.auth-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 44px 44px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 44px 44px,
        radial-gradient(1000px 520px at 90% -10%, rgba(226, 174, 69, 0.18), transparent 60%),
        radial-gradient(900px 600px at 0% 110%, rgba(74, 108, 179, 0.32), transparent 60%),
        linear-gradient(160deg, #172d59 0%, #0f2147 55%, #0a1630 100%);
    padding: var(--space-6);
    box-sizing: border-box;
}

.auth-topbar {
    width: 100%;
    max-width: 960px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}
.auth-home-link, .auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: #fff;
    text-decoration: none;
    font-size: 0.88rem;
}
.auth-home-link img { width: 32px; height: 32px; border-radius: 50%; }
.auth-home-link strong { font-size: 1rem; }
.auth-home-org { color: rgba(255, 255, 255, 0.7); margin-left: 4px; }
.auth-back-link {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
    font-weight: 600;
    transition: background var(--motion-fast);
}
.auth-back-link:hover { background: rgba(255, 255, 255, 0.14); }
.auth-home-link:focus-visible, .auth-back-link:focus-visible { outline: 3px solid #e2ae45; outline-offset: 2px; }

.auth-shell {
    width: 100%;
    max-width: 960px;
    display: flex;
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(3, 8, 20, 0.5);
    overflow: hidden;
    animation: auth-rise 520ms var(--motion-ease) backwards;
}
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.auth-credit {
    margin: var(--space-5) 0 0;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    text-align: center;
    color: var(--text-secondary);
}
.auth-credit a, .auth-footnote a { color: var(--accent-text); font-weight: 600; }

.auth-panel {
    display: flex;
    flex-direction: column;
}

/* Left panel: navy Dr. Yanga's Colleges identity - deliberately
   visually stronger than the LabPulse product name below it (the
   school seal + name are large/primary, "LabPulse" is a small product
   mark near the bottom), per the brand direction that the school
   identity should lead, not the product name. */
.auth-panel-brand {
    flex: 0 0 38%;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-3);
    padding: var(--space-8) var(--space-6);
    background:
        radial-gradient(circle at 30% 20%, rgba(184, 134, 11, 0.25), transparent 55%),
        /* literal navy, not --primary-800 (the dark theme repaints that stop pale) */
        linear-gradient(160deg, #1e3a70, #0a1630);
}
.auth-brand-logo {
    display: block;
    width: 100%;
    max-width: 112px;
    height: auto;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
    box-shadow: 0 0 0 6px rgba(226, 174, 69, 0.16), 0 12px 32px rgba(3, 8, 20, 0.4);
    object-fit: contain;
}
.auth-brand-name {
    margin: 0 0 var(--space-2);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--neutral-0);
}
.auth-brand-tagline {
    margin: 0 0 var(--space-6);
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.78);
}
.auth-brand-product {
    margin: 0;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-400);
}

/* Right panel: the actual form. */
.auth-panel-form {
    flex: 1;
    min-width: 0;
    background: var(--surface-card);
    padding: var(--space-8);
}
.auth-card {
    width: 100%;
}

.auth-title {
    margin: 0 0 4px;
}
.auth-subtitle {
    margin: 0 0 var(--space-5);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.auth-hint {
    margin: var(--space-4) 0 0;
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-secondary);
}

.auth-footnote {
    margin: var(--space-6) 0 0;
    font-size: 0.76rem;
    text-align: center;
    color: var(--text-muted);
}

#loginError,
#changePasswordError {
    margin-bottom: var(--space-4);
}

/* Below ~760px there isn't room for two side-by-side panels - the
   brand panel becomes a compact top banner (smaller seal, no tagline
   pill duplication of effort) above a full-width form panel, keeping
   the same visual identity without squeezing either side unreadably
   thin. Mirrors the app shell's own single sidebar breakpoint
   philosophy (layout.css, 992px) without borrowing its exact value,
   since this two-panel card has a different natural width than the
   full dashboard sidebar. */
@media (max-width: 760px) {
    .auth-body { justify-content: flex-start; padding: var(--space-4); gap: var(--space-4); }
    .auth-home-org { display: none; }
    .auth-shell {
        flex-direction: column;
        max-width: 440px;
    }
    .auth-panel-brand {
        flex: none;
        padding: var(--space-6) var(--space-5);
    }
    .auth-brand-logo {
        max-width: 64px;
        margin-bottom: var(--space-2);
    }
    .auth-brand-name {
        font-size: 1.15rem;
    }
    .auth-brand-tagline {
        margin-bottom: var(--space-3);
    }
    .auth-panel-form {
        padding: var(--space-6);
    }
}

/* Phase 9A Step 76H: Developer first-login setup progress (pages/developer-setup.php). */
.dev-setup-steps {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    list-style: none;
    margin: 0 0 var(--space-4);
    padding: 0;
    counter-reset: devstep;
    font-size: 0.85rem;
}
.dev-setup-steps li {
    counter-increment: devstep;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}
.dev-setup-steps li::before { content: counter(devstep); font-weight: 700; }
.dev-setup-steps li[data-done="true"] { color: var(--status-available-fg); border-color: currentColor; }
.dev-setup-steps li[data-done="true"]::before { content: "\2713"; }
.dev-setup-steps li[aria-current="step"] { color: var(--text-primary); border-color: var(--accent-500); font-weight: 600; }
/* Phase 9B Step 77: Website Maintenance page. */
.maintenance-notice { text-align: center; display: grid; gap: var(--space-3); justify-items: center; }
.maintenance-notice-icon { display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-50); color: var(--accent-text); }
.maintenance-notice-icon .icon { width: 28px; height: 28px; }
.maintenance-message { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-primary); max-width: 46ch; overflow-wrap: anywhere; }
.maintenance-estimate { margin: 0; color: var(--text-secondary); }
.maintenance-staff { margin: var(--space-2) 0 0; font-size: 0.9rem; }
.maintenance-staff a { color: var(--accent-text); font-weight: 600; }
/* Additional Improvements #1: Maintenance Access Code form (replaces the staff sign-in link during maintenance). */
.maintenance-access { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); display: grid; gap: var(--space-3); }
.maintenance-access-title { margin: 0; font-size: 1rem; color: var(--text-primary); }
.maintenance-access .input { letter-spacing: 0.08em; }
/* Phase 9B Step 79: links inside running text are underlined, not told apart by colour alone (WCAG 1.4.1). */
.auth-body p a:not(.btn), .auth-body .field-hint a, .auth-footnote a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- SOE Adjustment Batch 4: sign-in attempts and the pause countdown
   One panel under the title, coloured by state from the shared status tokens, so it follows the active theme (light and dark). */
.lp-login-state { display: grid; gap: 4px; margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md, 10px);
    border: 1px solid transparent; border-left-width: 4px; font-size: 0.9rem; line-height: 1.5; }
.lp-login-state[hidden] { display: none; }
.lp-login-state strong, .lp-login-state-title { font-weight: 700; }
.lp-login-state-title { display: block; }
.lp-login-state-note { display: block; font-size: 0.8rem; opacity: 0.85; }
.lp-login-state-error { background: var(--danger-50); color: var(--danger-700); border-color: color-mix(in srgb, var(--danger-700) 30%, transparent); }
.lp-login-state-warning { background: var(--status-idle-bg); color: var(--status-idle-fg); border-color: color-mix(in srgb, var(--status-idle-fg) 30%, transparent); }
.lp-login-state-locked { background: var(--danger-50); color: var(--danger-700); border-color: var(--danger-700); }
.lp-login-state-ready { background: var(--status-available-bg); color: var(--status-available-fg); border-color: color-mix(in srgb, var(--status-available-fg) 30%, transparent); }
.lp-login-countdown { display: inline-block; min-width: 3.2em; font-family: var(--font-mono, ui-monospace, monospace); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
#loginSubmit[aria-disabled="true"] { cursor: not-allowed; }