:root {
    --bg: #0b1220;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.10);
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --error-text: #b91c1c;
    --hero-from: #1e1b4b;
    --hero-via: #312e81;
    --hero-to: #4338ca;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: 'Inter', 'Segoe UI', Roboto, sans-serif; color: var(--text); }
body { background: #f8fafc; }

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

/* Hero (left) */
.auth-hero {
    background: linear-gradient(140deg, var(--hero-from) 0%, var(--hero-via) 50%, var(--hero-to) 100%);
    color: rgba(255,255,255,0.92);
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.auth-hero::before, .auth-hero::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; pointer-events:none;
}
.auth-hero::before { width: 380px; height: 380px; background: #6366f1; top: -120px; right: -120px; }
.auth-hero::after  { width: 320px; height: 320px; background: #06b6d4; bottom: -120px; left: -120px; opacity: .25; }

.hero-logo { display: flex; align-items: center; gap: .75rem; }
.logo-mark {
    width: 44px; height: 44px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
    font-weight: 700; letter-spacing: .04em; font-size: .85rem;
    backdrop-filter: blur(4px);
}
.logo-label { font-weight: 600; letter-spacing: .03em; opacity: .9; }

.hero-content { margin: auto 0; position: relative; z-index: 1; }
.hero-content h1 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); line-height: 1.15; margin: 0 0 1rem; font-weight: 700; }
.hero-content p { font-size: 1.05rem; line-height: 1.55; opacity: .8; max-width: 460px; margin: 0 0 2rem; }

.hero-bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.hero-bullets li { display: flex; align-items: flex-start; gap: .65rem; font-size: .95rem; opacity: .92; }
.dot {
    width: 10px; height: 10px; border-radius: 50%; margin-top: 7px;
    background: linear-gradient(135deg, #34d399, #06b6d4); box-shadow: 0 0 0 4px rgba(52,211,153,0.15);
    flex-shrink: 0;
}

.hero-footer { font-size: .8rem; opacity: .5; position: relative; z-index: 1; }

/* Form (right) */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--card); border-radius: 16px; padding: 2.5rem;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 12px 32px rgba(15,23,42,0.06);
}
.auth-head { margin-bottom: 1.75rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.brand-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-light); color: var(--primary); font-weight: 700;
}
.brand-name { font-weight: 700; color: var(--primary); letter-spacing: .02em; }
.auth-head h2 { margin: 0 0 .35rem; font-size: 1.6rem; font-weight: 700; }
.auth-head .sub { margin: 0; color: var(--muted); font-size: .95rem; }

.alert { display: flex; gap: .6rem; align-items: center; padding: .7rem .85rem; border-radius: 10px; margin-bottom: 1.25rem; font-size: .9rem; border: 1px solid; }
.alert.error { background: var(--error-bg); border-color: var(--error-border); color: var(--error-text); }

.field { display: block; margin-bottom: 1rem; }
.field .lbl { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; font-size: .82rem; color: var(--muted); font-weight: 500; }
.field .forgot { color: var(--primary); text-decoration: none; font-size: .82rem; font-weight: 500; }
.field .forgot:hover { text-decoration: underline; }
.field .ctl {
    position: relative; display: flex; align-items: center;
    background: #fff; border: 1.5px solid var(--border); border-radius: 10px;
    padding: 0 .85rem; transition: border-color .15s ease, box-shadow .15s ease;
}
.field .ctl:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.field .ctl .lead { color: var(--muted); flex-shrink: 0; }
.field .ctl input {
    flex: 1; border: 0; outline: 0; padding: .85rem .65rem;
    font-size: 1rem; color: var(--text); background: transparent; font-family: inherit;
}
.field .ctl input::placeholder { color: #cbd5e1; }
.reveal {
    background: transparent; border: 0; cursor: pointer; color: var(--muted);
    padding: 4px; display: flex; align-items: center;
}
.reveal:hover { color: var(--text); }

button.primary {
    width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .9rem 1rem; font-size: 1rem; font-weight: 600;
    color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 0; border-radius: 10px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(79,70,229,0.35);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
button.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(79,70,229,0.45); }
button.primary:active { transform: translateY(0); filter: brightness(.95); }

.seed-hint {
    display: flex; align-items: center; gap: .5rem;
    margin-top: 1.5rem; padding: .65rem .85rem;
    background: #f1f5f9; border-radius: 10px;
    font-size: .8rem; color: var(--muted);
}
.seed-hint code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; background: #fff; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); color: var(--text); }

/* 2FA card variant */
.code-input {
    width: 100%; text-align: center; font-size: 1.6rem;
    letter-spacing: .6rem; padding: 1rem; border: 1.5px solid var(--border);
    border-radius: 10px; outline: none; font-family: 'Inter', monospace;
    background: #f8fafc; transition: all .15s ease;
}
.code-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); background: #fff; }

@media (max-width: 960px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-main { padding: 1rem; }
}
