/* LCS :: design tokens (ReadyVan kit) (shared across public, admin, driver).
   LIGHT is primary. DARK is an opt-in [data-theme="dark"] override via the toggle.
   Single high-contrast indigo accent. No frameworks. */

:root {
  color-scheme: light;

  /* surfaces (light, primary) */
  --base: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #F1F3F5;
  --surface-3: #E7EAEE;
  --line: #E3E6EB;
  --line-soft: #EDEFF2;

  /* text */
  --text: #16181D;
  --muted: #5C636E;
  --muted-2: #8A919C;

  /* accent (indigo / violet) */
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-press: #4338CA;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(99, 102, 241, 0.10);
  --accent-line: rgba(99, 102, 241, 0.34);

  /* semantic */
  --green: #15803D;
  --green-soft: rgba(21, 128, 61, 0.11);
  --red: #DC2626;
  --red-soft: rgba(220, 38, 38, 0.10);
  --amber: #B45309;
  --amber-soft: rgba(217, 119, 6, 0.13);
  --blue: #2563EB;
  --blue-soft: rgba(37, 99, 235, 0.10);

  /* translucent chrome (sticky header/topbar) */
  --chrome-bg: rgba(255, 255, 255, 0.82);
  --hero-tint-1: rgba(99, 102, 241, 0.11);
  --hero-tint-2: rgba(99, 102, 241, 0.06);

  /* radii */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* shadow (light: soft, cool) */
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-2: 0 6px 20px rgba(16, 24, 40, 0.10);
  --shadow-3: 0 20px 48px rgba(16, 24, 40, 0.16);

  /* type */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --fs-hero: clamp(2.1rem, 5.2vw, 3.9rem);
  --fs-h1: clamp(1.8rem, 3.6vw, 2.7rem);
  --fs-h2: clamp(1.4rem, 2.6vw, 2rem);
  --fs-h3: clamp(1.15rem, 1.8vw, 1.4rem);
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.78rem;

  /* layout */
  --wrap: 1160px;
  --wrap-narrow: 820px;
  --gap: clamp(1rem, 3vw, 2rem);
  --nav-h: 64px;
}

/* DARK (secondary, opt-in via toggle) */
:root[data-theme="dark"] {
  color-scheme: dark;

  --base: #1B1D21;
  --surface: #232529;
  --surface-2: #2B2D33;
  --surface-3: #34363C;
  --line: #34363C;
  --line-soft: #2B2D33;

  --text: #F4F5F7;
  --muted: #9AA0A8;
  --muted-2: #6E747C;

  --accent: #818CF8;
  --accent-hover: #A5B4FC;
  --accent-press: #6366F1;
  --accent-ink: #0D0E10;
  --accent-soft: rgba(129, 140, 248, 0.16);
  --accent-line: rgba(129, 140, 248, 0.36);

  --green: #34D399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --red: #F87171;
  --red-soft: rgba(248, 113, 113, 0.14);
  --amber: #FBBF24;
  --amber-soft: rgba(251, 191, 36, 0.14);
  --blue: #60A5FA;
  --blue-soft: rgba(96, 165, 250, 0.14);

  --chrome-bg: rgba(27, 29, 33, 0.82);
  --hero-tint-1: rgba(129, 140, 248, 0.18);
  --hero-tint-2: rgba(129, 140, 248, 0.08);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-2: 0 6px 24px rgba(0, 0, 0, 0.30);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, 0.44);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 .5em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 700; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 700; line-height: 1;
  padding: .85rem 1.35rem; border-radius: var(--r); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, transform .06s, color .15s, box-shadow .15s;
  white-space: nowrap; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px var(--accent-line); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-accent:active { background: var(--accent-press); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted-2); background: var(--surface-2); }
.btn-surface { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-surface:hover { background: var(--surface-3); }
.btn-sm { padding: .55rem .9rem; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-lg { padding: 1.05rem 1.8rem; font-size: 1.08rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- badges / pills ---- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .01em;
  padding: .28rem .6rem; border-radius: var(--r-pill); border: 1px solid var(--line);
  color: var(--muted); background: var(--surface);
}
.badge-accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.badge-green { color: var(--green); background: var(--green-soft); border-color: transparent; }
.badge-red { color: var(--red); background: var(--red-soft); border-color: transparent; }
.badge-amber { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.badge-blue { color: var(--blue); background: var(--blue-soft); border-color: transparent; }

/* ---- cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
}

/* ---- forms ---- */
label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.hint { font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: .8rem .9rem; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 1.1rem; }

/* ---- utility ---- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); }
.wrap-narrow { max-width: var(--wrap-narrow); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 1rem; }
.row-wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* theme toggle button */
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); cursor: pointer; flex: none; }
.theme-toggle:hover { color: var(--text); border-color: var(--muted-2); }
.theme-toggle .ic-sun { display: none; }
.theme-toggle .ic-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: none; }

/* skeleton loader */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: var(--r-sm); }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* toast */
.toast-host { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r);
  padding: .8rem 1.1rem; box-shadow: var(--shadow-2); font-size: var(--fs-sm); font-weight: 600; }
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }
