/* Login page - split layout: product panel (left) + sign-in form (right). */

:root {
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #ffffff;
    --field: #f8fafc;
    --brand: #2563eb;
    --brand-600: #1d4ed8;
    --brand-ring: rgba(37, 99, 235, .18);
    --cyan: #22d3ee;
    --navy: #0b1220;
    --danger: #dc2626;
    --radius: 12px;
}

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

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr);
}

/* ------------------------------------------------------------ brand panel */
.brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 40px 56px;
    color: #e2e8f0;
    background: radial-gradient(1200px 600px at 10% -10%, #1e3a8a 0%, transparent 55%),
                radial-gradient(900px 500px at 110% 110%, #0e7490 0%, transparent 50%),
                var(--navy);
    isolation: isolate;
}

.brand__glow {
    position: absolute; inset: auto -20% -30% auto; width: 60%; aspect-ratio: 1;
    background: radial-gradient(circle, rgba(34, 211, 238, .18), transparent 60%);
    filter: blur(20px); z-index: -1;
}

.brand__grid {
    position: absolute; inset: 0; z-index: -1; opacity: .5;
    background-image: linear-gradient(rgba(148, 163, 184, .07) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(148, 163, 184, .07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
}

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.logo__mark {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    color: #fff; background: linear-gradient(135deg, #3b82f6, #06b6d4);
    box-shadow: 0 6px 18px rgba(37, 99, 235, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.logo__mark svg { width: 20px; height: 20px; }
.logo__name { font-size: 17px; color: #fff; }

.brand__body { margin: auto 0; max-width: 560px; padding: 48px 0 32px; }

.brand__title {
    margin: 0 0 16px; max-width: 520px; font-size: clamp(30px, 2.8vw, 42px); line-height: 1.12;
    font-weight: 800; letter-spacing: -.03em; color: #fff; text-wrap: balance;
}
.brand__title span {
    background: linear-gradient(90deg, #60a5fa, #22d3ee);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__lead { margin: 0 0 36px; font-size: 16px; line-height: 1.6; color: #94a3b8; max-width: 480px; }

/* product visual */
.preview { position: relative; margin: 0 40px 44px 0; }

.cam {
    position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .03) inset;
}
.cam__scene { display: block; width: 100%; height: 100%; }
.cam__lane { animation: lane 1.2s linear infinite; }
@keyframes lane { to { stroke-dashoffset: -30; } }

.cam__box {
    position: absolute; left: 41%; top: 51%; width: 17%; height: 19%;
    border: 2px solid var(--cyan); border-radius: 6px;
    box-shadow: 0 0 0 4px rgba(34, 211, 238, .12), 0 0 18px rgba(34, 211, 238, .35);
}
.cam__box span {
    position: absolute; left: -2px; bottom: calc(100% + 6px); white-space: nowrap;
    font-size: 11px; font-weight: 600; color: #0b1220; background: var(--cyan);
    padding: 3px 7px; border-radius: 5px;
}

.cam__hud {
    position: absolute; top: 12px; left: 12px; display: flex; gap: 8px;
    font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.cam__hud span {
    padding: 4px 8px; border-radius: 6px; color: #e2e8f0;
    background: rgba(15, 23, 42, .65); backdrop-filter: blur(6px);
}
.live { display: inline-flex; align-items: center; gap: 6px; color: #fff !important; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

.cam__speed {
    position: absolute; right: 12px; bottom: 12px; padding: 6px 10px; border-radius: 8px;
    font-size: 18px; font-weight: 700; color: #fff; background: rgba(15, 23, 42, .7); backdrop-filter: blur(6px);
}
.cam__speed small { font-size: 11px; font-weight: 500; color: #94a3b8; }

.alert-card, .map-card {
    position: absolute; display: flex; align-items: center; gap: 10px;
    border-radius: 12px; background: rgba(255, 255, 255, .96); color: var(--ink);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55);
}
.alert-card { left: -24px; bottom: -26px; padding: 10px 14px 10px 10px; animation: rise .7s .3s both cubic-bezier(.2, .8, .2, 1); }
.alert-card__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #fee2e2; color: #dc2626; font-size: 14px; }
.alert-card__text { display: flex; flex-direction: column; line-height: 1.25; }
.alert-card__text strong { font-size: 13px; }
.alert-card__text small { font-size: 11px; color: var(--muted); }

.map-card { right: -34px; top: -22px; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px 9px; animation: rise .7s .5s both cubic-bezier(.2, .8, .2, 1); }
.map-card svg { width: 128px; height: 64px; }
.map-card span { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.map-card__dot { animation: ping 1.8s infinite; transform-origin: 150px 18px; }
@keyframes ping { 50% { transform: scale(1.35); opacity: .7; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.features li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #94a3b8; }
.features i {
    display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px;
    font-size: 13px; color: #93c5fd; background: rgba(59, 130, 246, .12); border: 1px solid rgba(59, 130, 246, .2);
}
.features strong { color: #e2e8f0; font-weight: 600; }

.brand__foot { font-size: 12px; color: #64748b; }

/* ------------------------------------------------------------ form panel */
.panel { display: grid; place-items: center; padding: 48px 32px; background: var(--bg); }
.panel__inner { width: 100%; max-width: 380px; }

.logo--compact { display: none; margin-bottom: 28px; }
.logo--compact .logo__name { color: var(--ink); }

.panel__title { margin: 0 0 8px; font-size: 30px; font-weight: 700; letter-spacing: -.025em; }
.panel__sub { margin: 0 0 28px; font-size: 15px; line-height: 1.5; color: var(--muted); }

.error {
    display: none; margin-bottom: 18px; padding: 11px 14px; border-radius: 10px;
    font-size: 14px; color: #991b1b; background: #fef2f2; border: 1px solid #fecaca;
}

.form { display: grid; gap: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

.control { position: relative; }
.control input {
    width: 100%; height: 48px; padding: 0 44px; font: inherit; font-size: 15px; color: var(--ink);
    background: var(--field); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.control input::placeholder { color: #94a3b8; }
.control input:hover { border-color: #cbd5e1; }
.control input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.control__icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #94a3b8; pointer-events: none; transition: color .15s; }
.control:focus-within .control__icon { color: var(--brand); }
.control__toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
    font-size: 15px; color: #94a3b8; cursor: pointer; transition: color .15s, background .15s;
}
.control__toggle:hover { color: var(--ink-2); background: #eef2f7; }
.control__toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.helper { display: none; margin-top: 7px; font-size: 12.5px; font-weight: 500; color: #b45309; }

.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
    display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px;
    border: 1.5px solid #cbd5e1; background: #fff; color: #fff; font-size: 10px; transition: all .15s;
}
.check__box i { opacity: 0; transform: scale(.6); transition: all .15s; }
.check input:checked + .check__box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .check__box i { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { box-shadow: 0 0 0 4px var(--brand-ring); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 50px; margin-top: 6px; font: inherit; font-size: 15.5px; font-weight: 600; color: #fff;
    border: 0; border-radius: var(--radius); cursor: pointer;
    background: linear-gradient(180deg, #3b82f6, var(--brand));
    box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 8px 20px -6px rgba(37, 99, 235, .55);
    transition: transform .12s, box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.05); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 12px 26px -8px rgba(37, 99, 235, .6); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-ring), 0 8px 20px -6px rgba(37, 99, 235, .55); }
.btn:disabled { cursor: progress; filter: saturate(.8) brightness(.95); }

.panel__note { display: flex; align-items: center; gap: 8px; margin: 28px 0 0; font-size: 13px; color: var(--muted); }
.panel__note i { color: #16a34a; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
    .brand { padding: 36px 40px; }
    .preview { margin-right: 28px; }
}

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .brand { display: none; }
    .panel { min-height: 100vh; align-items: start; padding: 0; background:
        radial-gradient(700px 320px at 50% -120px, #1e3a8a 0%, transparent 70%), var(--navy); }
    .panel__inner {
        max-width: 440px; margin: 0 auto; padding: 40px 24px 32px;
        background: var(--bg); min-height: calc(100vh - 120px); margin-top: 120px;
        border-radius: 24px 24px 0 0;
    }
    .logo--compact { display: inline-flex; position: absolute; top: 40px; left: 50%; transform: translateX(-50%); }
    .logo--compact .logo__name { color: #fff; }
    .panel { position: relative; }
}

@media (max-width: 900px) and (min-height: 900px) {
    .panel__inner { min-height: auto; border-radius: 24px; margin-bottom: 40px; }
}

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

/* Short screens (laptops at 768px and similar): keep the panel within one screen. */
@media (min-width: 901px) and (max-height: 860px) {
    .brand { padding-top: 32px; padding-bottom: 28px; }
    .brand__body { padding: 28px 0 20px; }
    .brand__lead { margin-bottom: 28px; }
    .features { display: none; }
    .preview { max-width: 500px; margin-bottom: 34px; }
}
@media (min-width: 901px) and (max-height: 640px) {
    .preview { display: none; }
}
