/* Shared look for /login, /signup and /admin/login. Self-contained: does not rely on style.css. */
:root {
    --a-bg: #f5f7fb;
    --a-surface: #ffffff;
    --a-text: #0f172a;
    --a-muted: #64748b;
    --a-border: #e2e8f0;
    --a-input: #f8fafc;
    --a-primary: #2563eb;
    --a-primary-2: #4f46e5;
    --a-ring: rgba(37, 99, 235, .18);
    --a-ok: #059669;
    --a-ok-bg: #ecfdf5;
    --a-err: #dc2626;
    --a-err-bg: #fef2f2;
    --a-radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.auth {
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--a-text);
    background: var(--a-bg);
    -webkit-font-smoothing: antialiased;
}
.auth a { color: var(--a-primary); text-decoration: none; font-weight: 600; }
.auth a:hover { text-decoration: underline; }

/* ---------- layout ---------- */
.auth-shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 960px) { .auth-shell { grid-template-columns: minmax(380px, 46%) 1fr; } }

/* brand panel */
.auth-brand {
    position: relative; overflow: hidden; color: #fff;
    padding: 22px 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, var(--a-primary) 45%, var(--a-primary-2) 100%);
}
.auth-brand::before, .auth-brand::after {
    content: ""; position: absolute; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%);
}
.auth-brand::before { width: 520px; height: 520px; top: -180px; right: -200px; }
.auth-brand::after  { width: 420px; height: 420px; bottom: -200px; left: -160px; opacity: .7; }
.auth-brand-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }
@media (min-width: 960px) { .auth-brand { padding: 44px 52px; } }

.brand-logo { display: inline-flex; align-items: center; gap: 12px; color: #fff !important; text-decoration: none !important; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
    backdrop-filter: blur(6px);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; line-height: 1.1; display: block; }
.brand-tag { font-size: .75rem; opacity: .8; font-weight: 500; display: block; }

.brand-copy { display: none; margin: auto 0; padding: 40px 0; max-width: 460px; }
.brand-copy h1 { font-size: 2.4rem; line-height: 1.12; letter-spacing: -.025em; margin: 0 0 14px; font-weight: 800; }
.brand-copy p { margin: 0 0 28px; font-size: 1.02rem; line-height: 1.6; opacity: .88; }
.brand-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.brand-points li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.brand-points .tick {
    width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center;
    background: rgba(255,255,255,.18);
}
.brand-points .tick svg { width: 14px; height: 14px; }
.brand-foot { display: none; font-size: .8rem; opacity: .7; }
@media (min-width: 960px) {
    .brand-copy { display: block; }
    .brand-foot { display: block; }
}

/* form side */
.auth-main { display: flex; flex-direction: column; padding: 28px 16px 24px; }
@media (min-width: 640px) { .auth-main { padding: 40px 32px 28px; } }
.auth-top { display: flex; justify-content: flex-end; gap: 6px; font-size: .9rem; color: var(--a-muted); }
.auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.auth-card {
    width: 100%; max-width: 440px;
    animation: authIn .5s cubic-bezier(.2,.8,.2,1) both;
}
.auth-card.wide { max-width: 500px; }
@keyframes authIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.auth-card h2 { font-size: 1.9rem; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 800; }
.auth-card .sub { margin: 0 0 26px; color: var(--a-muted); line-height: 1.5; }
.auth-legal { text-align: center; font-size: .8rem; color: var(--a-muted); margin-top: 8px; }
.auth-legal svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }

/* ---------- alerts ---------- */
.a-alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
    font-size: .9rem; line-height: 1.45; border: 1px solid transparent;
    animation: authIn .35s ease both;
}
.a-alert-success { background: var(--a-ok-bg); color: #065f46; border-color: #a7f3d0; }
.a-alert-error, .a-alert-danger { background: var(--a-err-bg); color: #991b1b; border-color: #fecaca; }
.a-alert-info, .a-alert-warning, .a-alert-message { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ---------- fields ---------- */
.f { margin-bottom: 16px; }
.f-row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 520px) { .f-row.two { grid-template-columns: 1fr 1fr; } }
.f label, .f-label { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; font-weight: 600; margin-bottom: 7px; color: #334155; }
.f label .opt { font-weight: 500; color: var(--a-muted); font-size: .78rem; }
.f label a { font-size: .8rem; }

.f-ctl { position: relative; }
.f-ctl > svg.lead {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: #94a3b8; pointer-events: none; transition: color .2s;
}
.f-ctl input {
    width: 100%; height: 50px; padding: 0 14px 0 44px;
    font: inherit; font-size: .97rem; color: var(--a-text);
    background: var(--a-input); border: 1.5px solid var(--a-border); border-radius: 12px;
    outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none; appearance: none;
}
.f-ctl input::placeholder { color: #a0aec0; }
.f-ctl input:hover { border-color: #cbd5e1; }
.f-ctl input:focus { border-color: var(--a-primary); background: #fff; box-shadow: 0 0 0 4px var(--a-ring); }
.f-ctl:focus-within > svg.lead { color: var(--a-primary); }
.f-ctl.has-toggle input { padding-right: 48px; }
.f-ctl input.is-bad { border-color: var(--a-err); }
.f-ctl input.is-bad:focus { box-shadow: 0 0 0 4px rgba(220,38,38,.15); }
.f-ctl input.is-good { border-color: var(--a-ok); }

.pw-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent;
    display: grid; place-items: center; color: #94a3b8; cursor: pointer; transition: background .2s, color .2s;
}
.pw-toggle:hover { background: #eef2f7; color: #475569; }
.pw-toggle svg { width: 19px; height: 19px; }
.pw-toggle .eye-off { display: none; }
.pw-toggle.on .eye { display: none; }
.pw-toggle.on .eye-off { display: block; }

.f-hint { font-size: .78rem; margin-top: 6px; color: var(--a-muted); min-height: 1em; transition: color .2s; }
.f-hint.bad { color: var(--a-err); }
.f-hint.good { color: var(--a-ok); }

/* password strength */
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 8px; }
.pw-meter span { height: 4px; border-radius: 4px; background: #e2e8f0; transition: background .3s; }
.pw-meter[data-s="1"] span:nth-child(-n+1) { background: #ef4444; }
.pw-meter[data-s="2"] span:nth-child(-n+2) { background: #f59e0b; }
.pw-meter[data-s="3"] span:nth-child(-n+3) { background: #3b82f6; }
.pw-meter[data-s="4"] span:nth-child(-n+4) { background: #10b981; }

/* checkbox */
.f-check { display: flex; gap: 11px; align-items: flex-start; font-size: .86rem; color: #475569; line-height: 1.5; cursor: pointer; margin: 4px 0 20px; }
.f-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--a-primary); flex-shrink: 0; cursor: pointer; }

/* ---------- buttons ---------- */
.a-btn {
    position: relative; width: 100%; height: 50px; border: 0; border-radius: 12px; cursor: pointer;
    font: inherit; font-weight: 700; font-size: 1rem; color: #fff;
    background: linear-gradient(135deg, var(--a-primary), var(--a-primary-2));
    box-shadow: 0 8px 20px -8px rgba(37,99,235,.65);
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.a-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(37,99,235,.7); filter: brightness(1.05); }
.a-btn:active { transform: translateY(0); }
.a-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--a-ring); }
.a-btn[disabled] { cursor: progress; filter: saturate(.7); transform: none; }
.a-btn svg { width: 18px; height: 18px; }
.a-btn .spin { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: aspin .7s linear infinite; }
.a-btn.loading .spin { display: block; }
.a-btn.loading .lbl-idle { display: none; }
.a-btn .lbl-busy { display: none; }
.a-btn.loading .lbl-busy { display: inline; }
@keyframes aspin { to { transform: rotate(360deg); } }

.a-btn.ghost {
    color: var(--a-text); background: #fff; border: 1.5px solid var(--a-border); box-shadow: none;
}
.a-btn.ghost:hover { border-color: #cbd5e1; background: #f8fafc; filter: none; }
.a-btn.ghost .spin { border-color: rgba(15,23,42,.15); border-top-color: var(--a-primary); }

.a-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: #94a3b8; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.a-divider::before, .a-divider::after { content: ""; flex: 1; height: 1px; background: var(--a-border); }

.a-switch { text-align: center; color: var(--a-muted); font-size: .92rem; margin: 22px 0 0; }

/* segmented tabs (admin login) */
.a-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; background: #eef2f7; border-radius: 12px; margin-bottom: 22px; }
.a-tabs button {
    height: 40px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
    font: inherit; font-weight: 600; font-size: .88rem; color: #64748b; transition: background .2s, color .2s, box-shadow .2s;
}
.a-tabs button[aria-selected="true"] { background: #fff; color: var(--a-text); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.a-pane[hidden] { display: none; }
.a-pane { animation: authIn .3s ease both; }

/* feature chips under signup */
.a-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.a-chips span { font-size: .78rem; color: #475569; background: #fff; border: 1px solid var(--a-border); border-radius: 999px; padding: 6px 12px; }
.a-chips span::before { content: "✓"; color: var(--a-ok); font-weight: 800; margin-right: 6px; }

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