/* Agrin Email – landing, sign-in, verification. Standalone: no framework. */
:root {
    --bg: #f5f6fb;
    --surface: #ffffff;
    --text: #1b1f3b;
    --muted: #5b6080;
    --border: #d9dcec;
    --brand: #4f46e5;
    --brand-2: #7c3aed;
    --brand-contrast: #ffffff;
    --danger-bg: #fdecec;
    --danger-text: #9b1c1c;
    --ok-bg: #e8f7ee;
    --ok-text: #14663a;
    --panel-1: #312e81;
    --panel-2: #6d28d9;
    --shadow: 0 20px 50px rgba(30, 27, 75, .12);
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1020;
        --surface: #181a33;
        --text: #eceefb;
        --muted: #a3a8cf;
        --border: #2d3158;
        --brand: #818cf8;
        --brand-2: #a78bfa;
        --brand-contrast: #10112a;
        --danger-bg: #3a1a22;
        --danger-text: #fca5a5;
        --ok-bg: #12301f;
        --ok-text: #86efac;
        --shadow: 0 20px 50px rgba(0, 0, 0, .45);
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* Brand panel */
.brand-panel {
    background: linear-gradient(150deg, var(--panel-1), var(--panel-2));
    color: #fff;
    padding: clamp(32px, 6vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; color: #fff; text-decoration: none; }
.logo svg { width: 28px; height: 28px; }
.brand-panel h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; margin: 0 0 16px; letter-spacing: -.02em; }
.brand-panel .lead { font-size: 1.1rem; opacity: .9; max-width: 34ch; margin: 0; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.features li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.features .ico { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.features svg { width: 20px; height: 20px; }
.features strong { display: block; }
.features span { opacity: .8; font-size: .95rem; }
.brand-foot { font-size: .85rem; opacity: .7; }

/* Form panel */
.form-panel { display: grid; place-items: center; padding: clamp(20px, 5vw, 56px); }
.card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: clamp(24px, 4vw, 36px);
    box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 4px; font-size: 1.5rem; letter-spacing: -.01em; }
.card .sub { margin: 0 0 20px; color: var(--muted); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 12px; margin-bottom: 24px; }
.tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 10px; border-radius: 9px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
[role="tabpanel"][hidden] { display: none; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: .82rem; margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="text"], input[type="email"], input[type="password"], input[inputmode="numeric"] {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    transition: border-color .15s, box-shadow .15s;
}
input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.suffix { display: flex; align-items: stretch; }
.suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.suffix span { display: grid; place-items: center; padding: 0 12px; border: 1.5px solid var(--border); border-left: 0; border-radius: 0 10px 10px 0; color: var(--muted); background: var(--bg); font-size: .9rem; white-space: nowrap; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    font: inherit; font-weight: 600;
    color: var(--brand-contrast);
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border: 0; border-radius: 10px; padding: 12px 18px; cursor: pointer;
    text-decoration: none;
    transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--border); }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; font-size: .95rem; }
.alert.error { background: var(--danger-bg); color: var(--danger-text); }
.alert.success { background: var(--ok-bg); color: var(--ok-text); }

/* Verification */
.code-input { text-align: center; font-size: 1.9rem !important; letter-spacing: .5em; font-variant-numeric: tabular-nums; padding-left: calc(14px + .5em) !important; }
.center { text-align: center; }
.small { font-size: .9rem; color: var(--muted); }
.mt { margin-top: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .brand-panel { padding: 28px 20px; gap: 24px; }
    .features, .brand-foot { display: none; }
    .brand-panel .lead { max-width: none; }
}
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
