/* Kochi Taxi — Despatch auth design system
   Shared by login.php, forgot-password.php, reset-password.php */

:root {
    --bg:        #070b18;
    --panel:     #0b1226;
    --line:      rgba(148, 163, 184, .14);
    --line-soft: rgba(148, 163, 184, .08);
    --txt:       #e8edf7;
    --muted:     #94a3b8;
    --muted-2:   #64748b;
    --brand:     #38bdf8;
    --brand-2:   #6366f1;
    --danger:    #f87171;
    --ok:        #34d399;
    --ease:      cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--txt);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, .brand-font {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    letter-spacing: -.02em;
}

a { color: inherit; }

/* ---------- Layout shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr .95fr; }

/* ---------- Left: brand stage ---------- */
.stage {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4.5rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: radial-gradient(120% 120% at 0% 0%, #101a37 0%, #0a1122 45%, #070b18 100%);
    border-right: 1px solid var(--line-soft);
}
.stage::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(148,163,184,.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148,163,184,.055) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(110% 90% at 20% 10%, #000 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(110% 90% at 20% 10%, #000 30%, transparent 78%);
    pointer-events: none;
}

.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; will-change: transform; }
.orb.a { width: 460px; height: 460px; top: -140px; left: -120px;
    background: radial-gradient(circle at 30% 30%, #2563eb, transparent 62%);
    animation: drift1 18s var(--ease) infinite alternate; }
.orb.b { width: 380px; height: 380px; bottom: -150px; right: -90px;
    background: radial-gradient(circle at 60% 40%, #06b6d4, transparent 64%);
    animation: drift2 22s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate3d(70px, 50px, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(-60px, -40px, 0) scale(1.12); } }

.stage-inner { position: relative; z-index: 2; max-width: 30rem; }

.mark {
    width: 56px; height: 56px; display: grid; place-items: center;
    border-radius: 15px;
    background: linear-gradient(140deg, var(--brand), var(--brand-2));
    box-shadow: 0 14px 34px -12px rgba(56,189,248,.65), inset 0 1px 0 rgba(255,255,255,.35);
    margin-bottom: 1.75rem;
}
.mark svg { width: 28px; height: 28px; color: #06101f; }

.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand);
    padding: .4rem .7rem;
    border: 1px solid rgba(56,189,248,.28);
    border-radius: 999px;
    background: rgba(56,189,248,.07);
    margin-bottom: 1.5rem;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(56,189,248,.18); }

.stage h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 800; line-height: 1.08; margin: 0 0 1rem; }
.stage h1 .grad {
    background: linear-gradient(92deg, var(--brand) 0%, #a5b4fc 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stage p.lead { color: var(--muted); font-size: 1.02rem; line-height: 1.65; margin: 0 0 2.25rem; max-width: 26rem; }

.features { display: grid; gap: 1rem; }
.feature { display: flex; gap: .9rem; align-items: flex-start; }
.feature .ico {
    flex: none; width: 38px; height: 38px; border-radius: 11px;
    display: grid; place-items: center;
    background: rgba(148,163,184,.07);
    border: 1px solid var(--line);
    color: var(--brand);
}
.feature .ico svg { width: 18px; height: 18px; }
.feature h3 { margin: 0 0 .15rem; font-size: .92rem; font-weight: 700; }
.feature p { margin: 0; font-size: .82rem; color: var(--muted-2); line-height: 1.5; }

.stage-foot {
    position: relative; z-index: 2;
    display: flex; align-items: center; gap: 1.25rem;
    font-size: .76rem; color: var(--muted-2);
    padding-top: 2rem;
}
.stage-foot .pill { display: inline-flex; align-items: center; gap: .45rem; }
.stage-foot .pill svg { width: 14px; height: 14px; color: var(--ok); }

/* ---------- Right: auth panel ---------- */
.auth {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: clamp(1.5rem, 5vw, 3rem);
    background: radial-gradient(80% 60% at 100% 0%, rgba(99,102,241,.10), transparent 60%), var(--panel);
}

.card { width: 100%; max-width: 25rem; position: relative; }

.mobile-brand { display: none; align-items: center; gap: .8rem; margin-bottom: 1.75rem; }
.mobile-brand .mark { width: 44px; height: 44px; border-radius: 12px; margin: 0; }
.mobile-brand .mark svg { width: 22px; height: 22px; }
.mobile-brand b { font-size: 1rem; font-weight: 700; }
.mobile-brand span { display: block; font-size: .74rem; color: var(--muted-2); }

.card-head { margin-bottom: 1.75rem; }
.card-head h2 { margin: 0 0 .4rem; font-size: 1.6rem; font-weight: 800; }
.card-head p { margin: 0; color: var(--muted); font-size: .9rem; }

/* Alert / notice */
.alert {
    display: flex; gap: .65rem; align-items: flex-start;
    padding: .85rem 1rem; border-radius: 12px; font-size: .85rem; margin-bottom: 1.35rem;
    border: 1px solid rgba(248,113,113,.32);
    background: rgba(248,113,113,.09);
    color: #fecaca;
    animation: shake .4s var(--ease);
}
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--danger); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.notice {
    display: flex; gap: .65rem; align-items: flex-start;
    padding: .85rem 1rem; border-radius: 12px; font-size: .85rem; margin-bottom: 1.35rem;
    border: 1px solid rgba(52,211,153,.32);
    background: rgba(52,211,153,.09);
    color: #bbf7d0;
}
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--ok); }

/* Fields */
.field { position: relative; margin-bottom: 1.05rem; }
.field .f-ico {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--muted-2);
    transition: color .2s var(--ease);
    pointer-events: none;
}
.field input {
    width: 100%;
    padding: 1.15rem .95rem .5rem 2.75rem;
    font: inherit; font-size: .92rem;
    color: var(--txt);
    background: rgba(148,163,184,.05);
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.field input::placeholder { color: transparent; }
.field label {
    position: absolute; left: 2.75rem; top: .92rem;
    font-size: .92rem; color: var(--muted-2);
    pointer-events: none; transform-origin: left center;
    transition: transform .18s var(--ease), color .18s var(--ease), font-weight .18s var(--ease);
}
.field input:focus {
    border-color: rgba(56,189,248,.55);
    background: rgba(56,189,248,.05);
    box-shadow: 0 0 0 4px rgba(56,189,248,.12);
}
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label {
    transform: translateY(-.72rem) scale(.78);
    font-weight: 600; color: var(--brand);
}
.field input:focus ~ .f-ico { color: var(--brand); }

.field.pw input { padding-right: 3rem; }
.toggle-pw {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center;
    background: transparent; border: none; cursor: pointer; color: var(--muted-2);
    transition: color .2s, background .2s;
}
.toggle-pw:hover { color: var(--txt); background: rgba(148,163,184,.1); }
.toggle-pw svg { width: 18px; height: 18px; }
.toggle-pw .eye-off { display: none; }
.toggle-pw.on .eye { display: none; }
.toggle-pw.on .eye-off { display: block; }

.row-between { display: flex; align-items: center; justify-content: space-between; margin: .35rem 0 1.4rem; font-size: .82rem; }
.remember { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); cursor: pointer; user-select: none; }
.remember input { appearance: none; width: 17px; height: 17px; border: 1px solid var(--line); border-radius: 5px; background: rgba(148,163,184,.06); position: relative; cursor: pointer; transition: .18s var(--ease); }
.remember input:checked { background: linear-gradient(140deg, var(--brand), var(--brand-2)); border-color: transparent; }
.remember input:checked::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 4px; height: 9px; border: solid #06101f; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.link-quiet { color: var(--muted); text-decoration: none; transition: color .2s; }
.link-quiet:hover { color: var(--brand); }

/* Submit */
.btn {
    position: relative; width: 100%; border: none; cursor: pointer;
    padding: 1rem 1.25rem; border-radius: 12px;
    font: inherit; font-size: .94rem; font-weight: 700; letter-spacing: .01em;
    color: #06101f;
    background: linear-gradient(120deg, var(--brand) 0%, #818cf8 100%);
    box-shadow: 0 16px 34px -14px rgba(56,189,248,.75), inset 0 1px 0 rgba(255,255,255,.45);
    transition: transform .16s var(--ease), box-shadow .2s var(--ease), filter .2s;
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    overflow: hidden;
}
.btn:hover { transform: translateY(-1.5px); box-shadow: 0 20px 40px -14px rgba(56,189,248,.85), inset 0 1px 0 rgba(255,255,255,.45); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:disabled { cursor: progress; filter: saturate(.85) brightness(.96); }
.btn .spin { display: none; width: 17px; height: 17px; }
.btn.loading .label { opacity: 0; }
.btn.loading .spin { display: block; position: absolute; }
.btn .spin svg { width: 17px; height: 17px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    width: 100%; margin-top: .75rem;
    padding: .9rem 1.25rem; border-radius: 12px;
    font-size: .9rem; font-weight: 600;
    color: var(--muted); text-decoration: none;
    border: 1px solid var(--line); background: transparent;
    transition: color .2s, border-color .2s, background .2s;
}
.btn-ghost:hover { color: var(--txt); border-color: rgba(148,163,184,.3); background: rgba(148,163,184,.05); }
.btn-ghost svg { width: 16px; height: 16px; }

.card-foot {
    margin-top: 1.6rem; padding-top: 1.4rem;
    border-top: 1px solid var(--line-soft);
    display: flex; align-items: center; gap: .55rem;
    font-size: .78rem; color: var(--muted-2);
}
.card-foot svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.card-foot a { color: var(--muted); text-decoration: none; }
.card-foot a:hover { color: var(--brand); }

.hint { font-size: .78rem; color: var(--muted-2); line-height: 1.55; margin: 0 0 1.2rem; }

/* ---------- Entrance animation ---------- */
.rise { opacity: 0; transform: translateY(14px); animation: rise .7s var(--ease) forwards; }
.rise.d1 { animation-delay: .05s; }
.rise.d2 { animation-delay: .13s; }
.rise.d3 { animation-delay: .21s; }
.rise.d4 { animation-delay: .29s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .shell { grid-template-columns: 1fr; }
    .stage { display: none; }
    .auth { min-height: 100dvh; align-items: flex-start; padding-top: 3.5rem; }
    .mobile-brand { display: flex; }
}
@media (max-width: 420px) {
    .card-head h2 { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .rise { opacity: 1; transform: none; }
}
