:root {
    --ink: #07111f;
    --ink-soft: #10223a;
    --paper: #ffffff;
    --canvas: #edf2f6;
    --line: #d8dee6;
    --muted: #687385;
    --accent: #2f6feb;
    --danger: #b42318;
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input { font: inherit; }
a { color: inherit; }

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(420px, 48%) 1fr;
}

.brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(34px, 5vw, 68px);
    color: #fff;
    background:
        radial-gradient(circle at 85% 18%, rgba(67, 116, 188, .32), transparent 30%),
        radial-gradient(circle at 3% 96%, rgba(12, 115, 124, .36), transparent 35%),
        linear-gradient(145deg, #07111f 0%, #0b1e36 62%, #071526 100%);
}

.brand-panel::before,
.brand-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
}
.brand-panel::before { width: 420px; height: 420px; right: -190px; bottom: -150px; }
.brand-panel::after { width: 560px; height: 560px; right: -230px; bottom: -220px; }

.brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 850;
    letter-spacing: .18em;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    color: var(--ink);
    background: #fff;
    font-weight: 900;
    font-size: 21px;
    letter-spacing: -.08em;
    box-shadow: 0 10px 35px rgba(0,0,0,.2);
}

.brand-copy { position: relative; z-index: 1; max-width: 620px; margin: 80px 0 56px; }
.eyebrow, .card-kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: #a7c8ff; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: #6ea3ff; box-shadow: 0 0 0 5px rgba(110,163,255,.12); }
.brand-copy h1 { margin: 22px 0 24px; max-width: 650px; font-size: clamp(52px, 5.5vw, 84px); line-height: .95; letter-spacing: -.055em; }
.lead { max-width: 570px; margin: 0; color: #c3cedd; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.65; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 42px; }
.feature-grid > div { padding: 18px 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.055); backdrop-filter: blur(12px); }
.feature-grid strong, .feature-grid span { display: block; }
.feature-grid strong { margin-bottom: 7px; font-size: 14px; }
.feature-grid span { color: #9eacbf; font-size: 12px; line-height: 1.45; }
.brand-footer { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: #8fa0b6; font-size: 13px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #45d48a; box-shadow: 0 0 0 5px rgba(69,212,138,.1); }

.form-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(22px, 5vw, 64px);
    background:
        radial-gradient(circle at 100% 0, rgba(199, 215, 232, .55), transparent 35%),
        linear-gradient(135deg, #f8fafc, #e9eff5);
}

.login-card {
    width: min(100%, 520px);
    padding: clamp(30px, 4vw, 48px);
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(191, 201, 212, .72);
    border-radius: 28px;
    box-shadow: 0 25px 70px rgba(20, 35, 54, .12);
}
.mobile-brand { display: none; }
.card-kicker { margin: 0 0 12px; color: var(--accent); }
.card-heading h2 { margin: 0; font-size: clamp(34px, 4vw, 45px); line-height: 1.08; letter-spacing: -.04em; }
.card-heading > p:last-child { margin: 12px 0 0; color: var(--muted); line-height: 1.6; }

.app-switcher { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 28px 0; }
.app-option {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
}
.app-option:hover { transform: translateY(-1px); border-color: #aab6c5; }
.app-option.is-active { border-color: var(--ink); background: #f3f6f9; box-shadow: 0 0 0 2px rgba(7,17,31,.08); }
.app-icon { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 9px; border-radius: 8px; background: #e9edf2; font-weight: 850; font-size: 13px; }
.app-option.is-active .app-icon { background: var(--ink); color: white; }
.app-option strong, .app-option small { display: block; overflow: hidden; text-overflow: ellipsis; }
.app-option strong { font-size: 13px; }
.app-option small { display: none; margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; }

.alert { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; padding: 13px 15px; border: 1px solid #f2c8c5; border-radius: 12px; color: var(--danger); background: #fff5f4; font-size: 13px; line-height: 1.45; }
.alert > span { display: grid; place-items: center; flex: 0 0 20px; height: 20px; border-radius: 50%; color: white; background: var(--danger); font-weight: 800; font-size: 11px; }

form label, .label-row { font-size: 13px; font-weight: 750; }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }
.label-row a, .back-link { color: #536277; text-decoration: none; font-weight: 650; }
.label-row a:hover, .back-link:hover { text-decoration: underline; }
.input-wrap { position: relative; margin-top: 8px; }
.input-wrap > svg { position: absolute; top: 50%; left: 15px; width: 19px; height: 19px; transform: translateY(-50%); fill: none; stroke: #708096; stroke-width: 1.7; }
.input-wrap input, .code-input { width: 100%; height: 56px; border: 1px solid var(--line); border-radius: 13px; outline: none; color: var(--ink); background: #fff; transition: border-color .18s, box-shadow .18s; }
.input-wrap input { padding: 0 48px 0 45px; }
.input-wrap input:focus, .code-input:focus { border-color: #66768c; box-shadow: 0 0 0 4px rgba(27, 51, 83, .09); }
.input-wrap input::placeholder, .code-input::placeholder { color: #9ba5b3; }
.password-toggle { position: absolute; top: 50%; right: 8px; display: grid; place-items: center; width: 40px; height: 40px; transform: translateY(-50%); border: 0; border-radius: 9px; color: #66768c; background: transparent; cursor: pointer; }
.password-toggle:hover { background: #eef2f6; }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.submit-button { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 56px; margin-top: 24px; padding: 0 22px; border: 0; border-radius: 13px; color: #fff; background: var(--ink); box-shadow: 0 12px 28px rgba(7,17,31,.2); font-weight: 800; cursor: pointer; transition: transform .18s, background .18s, box-shadow .18s; }
.submit-button:hover { transform: translateY(-1px); background: #14263d; box-shadow: 0 15px 32px rgba(7,17,31,.24); }
.submit-button:focus-visible, .app-option:focus-visible, .password-toggle:focus-visible { outline: 3px solid rgba(47,111,235,.35); outline-offset: 2px; }
.submit-button.is-loading { pointer-events: none; opacity: .72; }

.security-note { display: flex; gap: 11px; margin-top: 28px; padding-top: 22px; border-top: 1px solid #e5e9ee; color: var(--muted); font-size: 12px; line-height: 1.5; }
.security-note svg { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: #56677d; stroke-width: 1.6; }
.support { margin: 20px 0 0; color: #788595; font-size: 12px; }
.support a { font-weight: 700; text-decoration: none; }
.support a:hover { text-decoration: underline; }

.verify-card { max-width: 500px; }
.back-link { display: inline-block; margin-bottom: 30px; font-size: 13px; }
.verify-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 22px; border-radius: 16px; color: #fff; background: var(--ink); font-size: 24px; font-weight: 850; }
.verify-card .card-heading { margin-bottom: 26px; }
.code-input { margin-top: 8px; padding: 0 18px; text-align: center; font-size: 25px; font-weight: 800; letter-spacing: .32em; font-variant-numeric: tabular-nums; }

@media (min-width: 1150px) {
    .app-option { display: flex; align-items: center; gap: 9px; }
    .app-icon { flex: 0 0 30px; margin: 0; }
}

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .brand-panel { display: none; }
    .form-panel { min-height: 100vh; min-height: 100dvh; padding: 20px; }
    .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; font-size: 13px; letter-spacing: .13em; }
    .mobile-brand .brand-mark { width: 38px; height: 38px; border: 1px solid #dce2e9; color: white; background: var(--ink); font-size: 16px; box-shadow: none; }
}

@media (max-width: 520px) {
    .form-panel { padding: 0; background: #fff; justify-content: flex-start; }
    .login-card { min-height: 100vh; min-height: 100dvh; padding: 28px 22px; border: 0; border-radius: 0; box-shadow: none; }
    .support { display: none; }
    .card-heading h2 { font-size: 34px; }
    .app-switcher { gap: 6px; }
    .app-option { padding: 9px 7px; text-align: center; }
    .app-icon { margin: 0 auto 7px; }
    .app-option strong { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
