:root {
    --base:       #061428;
    --near:       #0a1e38;
    --accent:     #2b7de9;
    --accent-hi:  #3b9eff;
    --white:      #ffffff;
    --off-white:  #f8fafc;
    --light-blue: #eef5ff;
    --border:     #dde6f2;
    --text:       #1a2b42;
    --muted:      #5a6f8a;
    --soft:       #7a8fa8;
    --text-on-dark: #e8f2fc;
    --dim-on-dark:  rgba(200, 220, 255, 0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body.auth-body {
    font-family: 'Inter', sans-serif;
    background: var(--white);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ── Left panel (blue) ── */
.auth-visual {
    position: relative;
    background: linear-gradient(160deg, var(--base) 0%, var(--near) 50%, #0f3460 100%);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    overflow: hidden;
}

.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 80% 20%, rgba(59, 158, 255, 0.2) 0%, transparent 60%),
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: auto, 40px 40px, 40px 40px;
    pointer-events: none;
}

.auth-visual-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}

.auth-visual-content {
    position: relative;
    z-index: 1;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--dim-on-dark);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s;
    margin-bottom: 3rem;
}

.auth-back:hover { color: var(--text-on-dark); }

.auth-back svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.auth-visual h1 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    max-width: 380px;
}

.auth-visual h1 em {
    font-style: italic;
    color: rgba(200, 220, 255, 0.45);
}

.auth-visual-lead {
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.75;
    color: var(--dim-on-dark);
    max-width: 360px;
    margin-bottom: 2.5rem;
}

.auth-perks {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-perks li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--dim-on-dark);
}

.auth-perks li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-hi);
    flex-shrink: 0;
}

.auth-visual-footer {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    color: rgba(200, 220, 255, 0.4);
    letter-spacing: 0.04em;
}

/* ── Right panel (white) ── */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: var(--white);
}

.auth-form-wrap {
    width: 100%;
    max-width: 400px;
}

.auth-form-wrap--wide {
    max-width: 420px;
}

.auth-form-panel--scroll {
    overflow-y: auto;
    align-items: flex-start;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    margin-bottom: 2.5rem;
}

.auth-logo-pill {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(43, 125, 233, 0.35);
    padding: 0.25rem 0.6rem;
    border-radius: 3px;
}

.auth-form-header {
    margin-bottom: 2rem;
}

.auth-form-header h2 {
    font-family: 'Instrument Serif', serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.auth-form-header p {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 300;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.auth-input-wrap {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input:focus {
    background: var(--white);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 125, 233, 0.12);
}

.auth-input.input-error {
    border-color: #e05252;
}

.auth-input-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--soft);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.auth-input-toggle:hover { color: var(--text); }

.auth-input-wrap .auth-input { padding-right: 2.75rem; }

.field-error {
    font-size: 0.78rem;
    color: #d64545;
    margin-top: 0.4rem;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
}

.auth-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.auth-forgot {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.auth-forgot:hover { opacity: 0.75; }

.auth-submit {
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white);
    background: var(--accent);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.auth-submit:hover {
    background: #2568c7;
    box-shadow: 0 6px 20px rgba(43, 125, 233, 0.3);
}

.auth-submit:active { transform: scale(0.99); }

.auth-alert {
    padding: 0.85rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.75rem 0;
    color: var(--soft);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-footer-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted);
}

.auth-footer-text a {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}

.auth-footer-text a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-visual {
        padding: 2rem 1.5rem;
        min-height: auto;
    }
    .auth-visual h1 { font-size: 1.75rem; }
    .auth-perks { display: none; }
    .auth-visual-footer { display: none; }
    .auth-form-panel { padding: 2rem 1.5rem 3rem; }
    .auth-form-wrap { max-width: 100%; }
}
