/* Login page: split layout with an animated brand panel (left) and the sign-in form (right). */
:root {
  --brand: #1a6fa8;
  --brand-2: #0b3d5c;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --night: color-mix(in srgb, var(--brand-2) 70%, #020617);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.login-page {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #fff;
}

.login-shell { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(420px, 1fr); min-height: 100vh; }
@media (min-width: 992px) { .login-shell { height: 100vh; min-height: 620px; } }

/* ================================================================== brand panel */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%),
    linear-gradient(160deg, var(--brand-2) 0%, var(--night) 100%);
  display: flex; flex-direction: column;
}

.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; }
.blob-1 { width: 420px; height: 420px; background: var(--brand); top: -120px; right: -80px; animation: drift 16s ease-in-out infinite alternate; }
.blob-2 { width: 320px; height: 320px; background: #7c3aed; top: 40%; left: -120px; opacity: .25; animation: drift 20s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.15); } }

.stars { position: absolute; inset: 0; pointer-events: none; }
.stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .2; animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .9; } }

/* map route, top right */
.route { position: absolute; top: 6%; right: 5%; width: min(36%, 340px); opacity: .9; }
.route-line { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 10; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -12; } }
.pin { fill: #fff; stroke: var(--brand); stroke-width: 3; }
.pin.end { fill: #fde68a; stroke: #f59e0b; }
.pin-pulse { fill: rgba(255,255,255,.5); transform-box: fill-box; transform-origin: center; animation: pulse 2s ease-out infinite; }
.pin-pulse.end { fill: rgba(253,230,138,.6); animation-delay: 1s; }
@keyframes pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(4); opacity: 0; } }
.route-dot { fill: #fde68a; filter: drop-shadow(0 0 6px #fde68a); }

/* headline + features */
.hero-content { position: relative; z-index: 2; padding: clamp(2rem, 5vw, 4.5rem); max-width: 760px; }
.brand-row { display: flex; align-items: center; gap: .75rem; margin-bottom: clamp(2rem, 7vh, 5rem); }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem;
  background: linear-gradient(135deg, #fff, #dbeafe); color: var(--brand-2);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.brand-logo { height: 46px; width: 46px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.brand-name { font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }

.hero-title { font-size: clamp(2rem, 3.6vw, 3.4rem); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; margin: 0 0 1rem; }
.grad-text {
  background: linear-gradient(90deg, #fde68a, #fff 45%, #93c5fd 90%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.hero-sub { font-size: 1.05rem; color: rgba(255,255,255,.75); max-width: 30rem; margin-bottom: 1.75rem; }

.hero-features { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-features li {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .9rem; border-radius: 999px; font-size: .88rem; font-weight: 500;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
}
.hero-features i { color: #fde68a; }

/* entrance animation */
.reveal { opacity: 0; transform: translateY(18px); animation: reveal .8s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--d, 0s); }
@keyframes reveal { to { opacity: 1; transform: none; } }

/* ================================================================== night city scene */
.scene { position: absolute; left: 0; right: 0; bottom: 0; height: 280px; }
.skyline { position: absolute; left: 0; bottom: 64px; display: flex; width: 3200px; line-height: 0; }
.skyline svg { flex-shrink: 0; }
.skyline.far { fill: rgba(255,255,255,.07); animation: scroll 90s linear infinite; }
.skyline.near { fill: color-mix(in srgb, var(--night) 80%, #000); animation: scroll 45s linear infinite; }
.skyline .twinkle { animation: twinkle 3s ease-in-out infinite; }
@keyframes scroll { to { transform: translateX(-1600px); } }

.road {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
  background: linear-gradient(#1f2937, #111827);
  border-top: 3px solid #374151;
}
.lane {
  position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.75) 0 40px, transparent 40px 80px);
  animation: lane .6s linear infinite;
}
@keyframes lane { to { background-position: -80px 0; } }

.cab { position: absolute; left: 14%; bottom: 10px; width: 280px; animation: bob .5s ease-in-out infinite alternate; }
.cab svg { width: 100%; height: auto; display: block; overflow: visible; }
.cab .stripe { fill: var(--brand); }
.cab .wheel { transform-box: fill-box; transform-origin: center; animation: spin .5s linear infinite; }
.cab .beam { animation: flicker 3s ease-in-out infinite; }
@keyframes bob { to { transform: translateY(-2px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flicker { 50% { opacity: .75; } }

/* ================================================================== sign-in form */
.auth {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem clamp(1.25rem, 4vw, 4rem); position: relative;
  background:
    radial-gradient(600px 300px at 100% 0%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 70%),
    #fff;
}
.auth-card { width: 100%; max-width: 400px; animation: cardIn .9s cubic-bezier(.2,.7,.2,1) both .15s; }
@keyframes cardIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

.auth-brand-mobile { display: none; align-items: center; gap: .65rem; margin-bottom: 1.75rem; }
.auth-brand-mobile .brand-mark { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.auth-brand-mobile .brand-logo { border: 1px solid var(--line); }

.auth-title { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin: 0 0 .35rem; }
.auth-sub { color: var(--muted); margin-bottom: 2rem; }

.auth-error {
  display: flex; align-items: center; gap: .55rem;
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
  padding: .7rem .9rem; border-radius: 12px; font-size: .9rem; margin-bottom: 1.25rem;
  animation: shake .45s ease both;
}

/* input with icon + floating label */
.field { position: relative; margin-bottom: 1rem; }
.field > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 1.1rem; transition: color .2s; pointer-events: none; }
.field input {
  width: 100%; height: 58px; padding: 1.35rem 3rem .4rem 2.9rem;
  border: 1.5px solid var(--line); border-radius: 14px; background: #f8fafc;
  font: inherit; font-size: .98rem; color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field label {
  position: absolute; left: 2.9rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: .98rem; pointer-events: none;
  transition: top .18s, font-size .18s, color .18s;
}
.field input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label { top: 17px; font-size: .72rem; font-weight: 600; color: var(--brand); }
.field:focus-within > i { color: var(--brand); }
.field.invalid input { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.12); }
.field.invalid { animation: shake .45s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.toggle-pass {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: #94a3b8; width: 38px; height: 38px; border-radius: 10px;
}
.toggle-pass:hover { color: var(--ink); background: #eef2f7; }

.caps-hint { font-size: .8rem; color: #b45309; height: 0; overflow: hidden; opacity: 0; transition: all .2s; }
.caps-hint.show { height: 1.4rem; opacity: 1; }

.auth-btn {
  position: relative; overflow: hidden; width: 100%; height: 54px; margin-top: .75rem;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; border-radius: 14px; color: #fff; font-weight: 700; font-size: 1rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--brand) 70%, transparent);
  transition: transform .15s, box-shadow .2s;
}
.auth-btn::after { /* sheen sweep on hover */
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.3) 50%, transparent 70%);
  transition: transform .7s;
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -8px color-mix(in srgb, var(--brand) 80%, transparent); }
.auth-btn:hover::after { transform: translateX(120%); }
.auth-btn:hover .bi-arrow-right { transform: translateX(4px); }
.auth-btn:active { transform: translateY(0); }
.auth-btn .bi-arrow-right { transition: transform .2s; }
.auth-btn .spinner-border { display: none; }
.auth-btn.loading { pointer-events: none; opacity: .9; }
.auth-btn.loading .spinner-border { display: inline-block; }
.auth-btn.loading .bi-arrow-right { display: none; }

.auth-foot { margin: 1.75rem 0 0; text-align: center; font-size: .82rem; color: var(--muted); }
.copyright { position: absolute; bottom: 1.25rem; font-size: .78rem; color: #94a3b8; }

/* ================================================================== responsive */
@media (min-width: 1800px) {
  .hero-content { max-width: 980px; padding: 5rem 6rem; }
  .brand-name { font-size: 1.5rem; }
  .hero-title { font-size: 4.6rem; }
  .hero-sub { font-size: 1.3rem; max-width: 38rem; }
  .hero-features li { font-size: 1.05rem; padding: .7rem 1.2rem; }
  .route { width: 440px; max-width: 30%; }
  .auth-card { max-width: 480px; }
  .auth-title { font-size: 2.6rem; }
  .auth-sub { font-size: 1.1rem; }
  .field input { height: 64px; font-size: 1.05rem; }
  .auth-btn { height: 60px; font-size: 1.1rem; }
  .cab { width: 360px; }
}
@media (max-width: 991.98px) {
  .login-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .hero { min-height: 230px; position: relative; }
  .hero-content, .route, .blob-2 { display: none; }
  .scene { height: 230px; }
  .cab { width: 220px; left: 8%; }
  .auth { padding-top: 2.5rem; padding-bottom: 4rem; }
  .auth-brand-mobile { display: flex; }
}
@media (max-width: 575.98px) {
  .hero { min-height: 170px; }
  .scene { height: 170px; }
  .skyline.far { bottom: 48px; } .skyline.near { bottom: 48px; }
  .road { height: 48px; }
  .cab { width: 170px; bottom: 6px; }
  .auth-title { font-size: 1.7rem; }
}

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