/* ================================================================
   Top Line Performance — Login Page (IOH Analyst Design System)
   Split-layout: red brand hero (left) + light form panel (right)
   ================================================================ */

:root {
    --ioh-red:     #ED1C24;
    --ioh-red-dk:  #c41017;
    --ioh-pink:    #EC008C;
    --ioh-yellow:  #FFCB05;
    --ioh-teal:    #32BCAD;
    --ioh-magenta: #C6168D;
    --ioh-ink:     #1A1A1B;
    --ioh-mute:    #7A7A7C;
    --ioh-rule:    #E5E5E7;
    --ioh-panel:   #F7F7F8;
    --ioh-white:   #FFFFFF;
    --ioh-red-bg:  #FFEBEC;
}

* { box-sizing: border-box; }

body {
    font-family: 'Prompt', 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--ioh-panel);
    color: var(--ioh-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Preloader ───────────────────────────────────────────────── */
.auth-preloader {
    position: fixed;
    inset: 0;
    background: rgba(247, 247, 248, 0.92);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.auth-preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.auth-preloader-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(237, 28, 36, 0.15);
    border-top-color: var(--ioh-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Page Shell ──────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--ioh-panel);
}

/* ─── Brand Hero (left) — light, IOH multi-color balanced ──────── */
.auth-hero {
    position: relative;
    overflow: hidden;
    background:
        /* dot-grid pattern overlay */
        radial-gradient(circle at 1px 1px, rgba(26, 26, 27, 0.08) 1px, transparent 0),
        /* color wash radial gradients (stronger) */
        radial-gradient(ellipse 560px 400px at 8% 8%, rgba(255, 203, 5, 0.32), transparent 60%),
        radial-gradient(ellipse 540px 420px at 96% 96%, rgba(236, 0, 140, 0.18), transparent 60%),
        radial-gradient(ellipse 620px 480px at 70% 38%, rgba(50, 188, 173, 0.12), transparent 60%),
        radial-gradient(ellipse 480px 360px at 30% 70%, rgba(198, 22, 141, 0.08), transparent 60%),
        linear-gradient(180deg, var(--ioh-white) 0%, var(--ioh-panel) 100%);
    background-size: 22px 22px, auto, auto, auto, auto, auto;
    color: var(--ioh-ink);
    padding: clamp(32px, 5vw, 56px) clamp(28px, 5vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    border-right: 1px solid var(--ioh-rule);
}

/* Decorative geometric shapes — each in a different IOH accent */
.auth-hero::before,
.auth-hero::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
}
.auth-hero::before {
    width: 320px;
    height: 320px;
    right: -110px;
    top: 60px;
    background: var(--ioh-yellow);
    opacity: 0.28;
}
.auth-hero::after {
    width: 220px;
    height: 220px;
    left: -90px;
    bottom: -70px;
    background: var(--ioh-pink);
    opacity: 0.14;
}

/* Extra decorative accents — float over the dot grid */
.auth-hero__top { position: relative; z-index: 1; }
.auth-hero__top::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--ioh-teal);
    right: 8%;
    top: 3rem;
    box-shadow: 0 0 0 6px rgba(50, 188, 173, 0.15);
}

/* Ring outline (pink, top-right) */
.auth-hero::before {
    box-shadow: 0 0 0 1px rgba(236, 0, 140, 0.15) inset;
}

/* Floating accent ring outline + filled square via .auth-hero__deco */
.auth-hero__deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.auth-hero__deco::before {
    content: '';
    position: absolute;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    border: 2px solid var(--ioh-magenta);
    opacity: 0.30;
    right: 14%;
    top: 24%;
}
.auth-hero__deco::after {
    content: '';
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--ioh-teal);
    opacity: 0.18;
    transform: rotate(18deg);
    right: 6%;
    top: 50%;
}

/* Diagonal IOH brand stripe (left edge accent) */
.auth-hero__stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(180deg,
        var(--ioh-red) 0%,
        var(--ioh-pink) 25%,
        var(--ioh-yellow) 50%,
        var(--ioh-teal) 75%,
        var(--ioh-magenta) 100%
    );
    z-index: 1;
}

.auth-hero__mid,
.auth-hero__bottom { position: relative; z-index: 1; }

.auth-hero__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-hero__brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--ioh-red);
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(237, 28, 36, 0.25);
}
.auth-hero__brand-mark img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.auth-hero__brand-text {
    font-family: 'Poppins', 'Inter', system-ui, sans-serif;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--ioh-ink);
}
.auth-hero__brand-sub {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ioh-mute);
    margin-top: 2px;
}

.auth-hero__eyebrow {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(236, 0, 140, 0.10);
    border: 1px solid rgba(236, 0, 140, 0.28);
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ioh-pink);
    margin-bottom: 18px;
}
.auth-hero__title {
    font-family: 'Poppins', 'Inter', system-ui, sans-serif;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    max-width: 460px;
    color: var(--ioh-ink);
}
.auth-hero__title em {
    font-style: normal;
    color: var(--ioh-red);
}
.auth-hero__lead {
    font-family: 'Prompt', sans-serif;
    font-size: clamp(14px, 1.4vw, 16px);
    font-weight: 400;
    line-height: 1.6;
    color: var(--ioh-grey, var(--ioh-mute));
    max-width: 440px;
    margin: 0;
}

.auth-hero__stats {
    display: flex;
    gap: 28px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.auth-hero__stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 12px;
    border-left: 3px solid var(--ioh-rule);
}
.auth-hero__stat:nth-child(1) { border-left-color: var(--ioh-red); }
.auth-hero__stat:nth-child(2) { border-left-color: var(--ioh-yellow); }
.auth-hero__stat:nth-child(3) { border-left-color: var(--ioh-teal); }

.auth-hero__stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(20px, 2.6vw, 28px);
    font-weight: 700;
    color: var(--ioh-ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    line-height: 1;
}
.auth-hero__stat-label {
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ioh-mute);
}

.auth-hero__bottom {
    font-size: 12px;
    font-weight: 500;
    color: var(--ioh-mute);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.auth-hero__bottom .dot {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--ioh-teal);
    display: inline-block;
    margin: 0 6px;
}

/* ─── Form Panel (right) ──────────────────────────────────────── */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vw, 56px) clamp(24px, 5vw, 48px);
    background: var(--ioh-panel);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--ioh-white);
    border: 1px solid var(--ioh-rule);
    border-radius: 16px;
    padding: 36px 32px 28px;
    box-shadow: 0 1px 2px rgba(45,41,38,.06), 0 12px 32px rgba(45,41,38,.06);
    position: relative;
    overflow: hidden;
    animation: cardEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--ioh-red) 0%, var(--ioh-pink) 40%, var(--ioh-yellow) 100%);
}
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-eyebrow {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ioh-pink);
    margin-bottom: 8px;
}
.auth-title {
    font-family: 'Poppins', 'Inter', system-ui, sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ioh-ink);
    margin: 0 0 4px;
}
.auth-subtitle {
    font-family: 'Prompt', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--ioh-mute);
    margin: 0 0 24px;
}

/* ─── Alert ──────────────────────────────────────────────────── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 18px;
    cursor: pointer;
}
.auth-alert.error {
    background: var(--ioh-red-bg);
    border-left: 4px solid var(--ioh-red);
    color: var(--ioh-red-dk);
}
.auth-alert.success {
    background: #E1F4EE;
    border-left: 4px solid var(--ioh-teal);
    color: #1f8e80;
}
.auth-alert.success i {
    color: var(--ioh-teal);
}
.auth-alert i {
    font-size: 16px;
    flex-shrink: 0;
    color: var(--ioh-red);
    margin-top: 1px;
}

/* ─── Form ───────────────────────────────────────────────────── */
.auth-form { margin: 0; }
.auth-form .mb-3 { margin-bottom: 16px; position: relative; }
.auth-form .position-relative { position: relative; }

.auth-form .form-label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ioh-mute);
    margin-bottom: 6px;
}

.auth-form .form-control {
    width: 100%;
    background: var(--ioh-white);
    border: 1.5px solid var(--ioh-rule);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: 'Prompt', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: var(--ioh-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 48px;
}
.auth-form .form-control::placeholder { color: #b5b5b7; font-weight: 400; }
.auth-form .form-control:focus {
    outline: none;
    border-color: var(--ioh-red);
    box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.12);
}
.auth-form .form-control:hover:not(:focus) {
    border-color: #d4d4d6;
}

/* ─── Password toggle ────────────────────────────────────────── */
#pwToggle {
    position: absolute !important;
    right: 8px !important;
    top: 31px !important;
    background: none;
    border: none;
    color: var(--ioh-mute);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    min-height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#pwToggle:hover { color: var(--ioh-red); background: var(--ioh-red-bg); }

/* ─── Remember me ────────────────────────────────────────────── */
.auth-form .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 0;
}
.auth-form .form-check-input {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--ioh-rule);
    border-radius: 4px;
    background: var(--ioh-white);
    accent-color: var(--ioh-red);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}
.auth-form .form-check-input:checked {
    background-color: var(--ioh-red);
    border-color: var(--ioh-red);
}
.auth-form .form-check-label {
    font-family: 'Prompt', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--ioh-grey, var(--ioh-mute));
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* ─── Submit Button ──────────────────────────────────────────── */
.auth-btn {
    width: 100%;
    background: var(--ioh-red);
    color: var(--ioh-white);
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.2s ease;
    min-height: 50px;
    position: relative;
    overflow: hidden;
}
.auth-btn:hover {
    background: var(--ioh-red-dk);
    box-shadow: 0 8px 20px rgba(237, 28, 36, 0.25);
}
.auth-btn:active { transform: translateY(1px); }
.auth-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    margin-top: 22px;
    font-family: 'Prompt', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--ioh-mute);
}
.auth-footer code {
    background: var(--ioh-panel);
    border: 1px solid var(--ioh-rule);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'Prompt', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--ioh-ink);
}

/* ─── Shake on error ─────────────────────────────────────────── */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.shake { animation: shake 0.5s ease-in-out; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-hero {
        min-height: auto;
        padding: 28px 24px;
    }
    .auth-hero__title { font-size: clamp(22px, 5vw, 32px); }
    .auth-hero__lead { display: none; }
    .auth-hero__stats { display: none; }
    .auth-hero__bottom { display: none; }
    .auth-hero__mid { margin-top: 24px; }
    .auth-panel { padding: 32px 20px 40px; }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 22px 24px;
        border-radius: 14px;
    }
    .auth-title { font-size: 22px; }
    .auth-form .form-control { font-size: 16px; min-height: 50px; }
    .auth-btn { font-size: 14px; min-height: 52px; }
    .auth-hero { padding: 22px 20px; }
}

/* ─── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .auth-preloader-spinner,
    .auth-card,
    .auth-alert,
    .shake { animation: none !important; }
    .auth-card { opacity: 1; transform: none; }
}
