/* ================================================================
   Aligo — design tokens
   Enterprise logistics-platform tone (Stripe / Linear / Uber Freight).
   Light is the default and the primary design; dark is a deliberately
   separate palette (not an inversion filter) that meets WCAG AA on its
   own terms — see the two override blocks below the base :root.
   Every color, radius and spacing value is a token; nothing is one-off.
   ================================================================ */
:root {
  /* Color */
  --primary: #0f172a;      /* headings, primary text                   */
  --accent: #2563eb;       /* the one brand action color — button fills;
                               stays this exact blue in both themes     */
  --accent-text: #2563eb;  /* accent used as text/icon/border instead of
                               a fill — same blue in light mode, lifted
                               one step in dark mode where the raw
                               --accent value falls short of AA as text */
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;  /* accent tint for icon chips / focus rings */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --header-bg: rgba(248, 250, 252, 0.85);
  --hero-illustration-bg: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);

  /* Fixed dark surface — the footer and the phone-mockup bezel are
     deliberately dark regardless of site theme (same convention Stripe
     and Linear use for their marketing footers), so this does NOT
     change between the light/dark blocks below. */
  --surface-inverse: #0f172a;

  /* Spacing — strict 8px scale */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 40px;
  --sp-6: 48px;
  --sp-8: 64px;
  --sp-10: 80px;
  --sp-12: 96px;
  --sp-16: 128px;

  /* Radius */
  --radius-sm: 8px;
  --radius-btn: 10px;
  --radius-card: 16px;
  --radius-pill: 999px;

  /* Shadow — one soft card shadow, one (slightly stronger) hover state.
     Nothing heavier is used anywhere on the page. */
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-card-hover: 0 4px 8px rgba(15, 23, 42, 0.05), 0 16px 40px rgba(15, 23, 42, 0.10);
  --shadow-btn: 0 1px 2px rgba(15, 23, 42, 0.05);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --theme-duration: 0.22s;
}

/* ---------- Dark theme ----------
   Not an inverted light theme: bg/card match the Flutter app's own
   AppColors.backgroundDark/surfaceDark (#0F172A / #1E293B) for a
   consistent brand across web and app.

   --accent itself (button fills) stays the exact same #2563eb in both
   themes — white text on it is 5.17:1 either way, so there was no
   reason to touch it. --accent-text is the one token that does change:
   it's what every *text*/icon/border use of the brand blue reads from
   instead, because #2563eb measures only ~2.8:1 as foreground text on
   the #1e293b card — below AA. #60a5fa fixes that (5.75:1 on card,
   7.02:1 on bg) without inventing a second brand color.
   --accent-hover lightens instead of darkens in dark mode (the
   opposite direction from light mode) since darkening a button here
   would make it recede into the dark page instead of lifting off it —
   the conventional dark-UI hover direction (Stripe/Linear both do
   this). It's momentary/interactive-only, so its slightly-under-AA
   3.68:1 with white text is an accepted trade-off, not an oversight.
   success/warning/danger are shifted one Tailwind step lighter
   (-400/500) for the same as-text-on-dark-surface reason. */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #f1f5f9;
    --accent-text: #60a5fa;
    --accent-hover: #3b82f6;
    --accent-soft: rgba(59, 130, 246, 0.16);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --bg: #0f172a;
    --card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --header-bg: rgba(15, 23, 42, 0.75);
    --hero-illustration-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  }
}
:root[data-theme="dark"] {
  --primary: #f1f5f9;
  --accent-text: #60a5fa;
  --accent-hover: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --bg: #0f172a;
  --card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --header-bg: rgba(15, 23, 42, 0.75);
  --hero-illustration-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}
/* An explicit "light" choice must win even when the OS prefers dark —
   re-assert every light value so it beats the media query above. */
:root[data-theme="light"] {
  --primary: #0f172a;
  --accent-text: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --header-bg: rgba(248, 250, 252, 0.85);
  --hero-illustration-bg: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--theme-duration) var(--ease), color var(--theme-duration) var(--ease);
}

body { font-size: 16px; line-height: 1.6; }

img, svg { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--sp-2); letter-spacing: -0.02em; font-weight: 700; color: var(--primary); }
h2 { font-size: 34px; letter-spacing: -0.01em; }
h3 { font-size: 18px; }
p { color: var(--text-secondary); line-height: 1.65; margin: 0 0 var(--sp-1); }

a { color: inherit; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 var(--sp-2);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-text);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: var(--card); color: var(--accent-text); border-color: var(--accent-text); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { color: var(--primary); }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ---------- Icon tiles (shared by Features + How it works) ---------- */
.icon-tile {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-tile svg { width: 24px; height: 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--theme-duration) var(--ease), border-color var(--theme-duration) var(--ease);
}
.header-inner {
  width: 100%;
  padding: var(--sp-2) clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 26px; width: auto; }
.site-nav { flex: 1; display: flex; gap: var(--sp-4); }
.site-nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
.site-nav a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: var(--sp-2); }
.icon-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease),
    background-color var(--theme-duration) var(--ease);
}
.icon-toggle:hover { border-color: var(--accent-text); color: var(--accent-text); }
.nav-burger {
  display: none;
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--primary);
  cursor: pointer;
}
.nav-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s var(--ease);
}
.nav-theme-toggle:hover { color: var(--primary); }
.nav-theme-toggle .theme-icon { font-size: 15px; transition: transform 0.25s var(--ease); }
.nav-theme-toggle:active .theme-icon { transform: rotate(-20deg) scale(0.9); }
/* Two instances, one visible at a time: the icon-only button in
   header-actions on desktop, the labeled row inside the nav (which
   becomes the mobile dropdown menu) below the 1024px breakpoint. */
#theme-toggle-mobile { display: none; }

/* ---------- Hero ---------- */
.hero {
  padding: var(--sp-12) clamp(20px, 4vw, 48px) var(--sp-10);
}
.hero-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--sp-10);
  align-items: center;
}
.hero h1 {
  font-size: clamp(36px, 4.6vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  text-wrap: balance;
  margin-bottom: var(--sp-3);
}
.hero-subtitle {
  font-size: 18px;
  line-height: 1.65;
  max-width: 480px;
  margin-bottom: var(--sp-4);
}
.hero-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-6); }

.hero-stats { display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.hero-stat-value { font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: -0.01em; }
.hero-stat-label { font-size: 13.5px; color: var(--text-secondary); margin-top: 2px; }

/* Hero illustration — abstract route/map panel with a floating status
   card, not a stock photo or decorative gradient blob. */
.hero-visual { position: relative; }
.hero-illustration {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-card);
  background: var(--hero-illustration-bg);
  border: 1px solid var(--border);
  transition: background-color var(--theme-duration) var(--ease), border-color var(--theme-duration) var(--ease);
}
.hero-floating-card {
  position: absolute;
  left: -12px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-2) var(--sp-3);
  box-shadow: var(--shadow-card-hover);
}
.hero-floating-card .icon-tile { background: rgba(16, 185, 129, 0.12); color: var(--success); width: 40px; height: 40px; }
.hero-floating-card .icon-tile svg { width: 20px; height: 20px; }
.hero-floating-card strong { display: block; font-size: 14px; color: var(--primary); }
.hero-floating-card span { font-size: 12.5px; color: var(--text-secondary); }
.hero-floating-badge {
  position: absolute;
  top: 20px;
  right: -10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  box-shadow: var(--shadow-card);
}
/* The auto-matching pitch made visible at a glance, not just in copy —
   mirrors .hero-floating-badge on the opposite corner. */
.hero-floating-match {
  position: absolute;
  top: 20px;
  left: -10px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 14px 8px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow-card);
}
.hero-floating-match .icon-tile { width: 22px; height: 22px; background: rgba(16, 185, 129, 0.14); color: var(--success); }
.hero-floating-match .icon-tile svg { width: 13px; height: 13px; }

/* ---------- Sections (shared rhythm) ---------- */
.section { max-width: 1200px; margin: 0 auto; padding: var(--sp-10) clamp(20px, 4vw, 48px); }
.section-alt { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 620px; margin: 0 auto var(--sp-6); text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }
.section-subtitle { font-size: 16.5px; }

/* About — short mission statement, not another card grid */
.about-copy { max-width: 720px; margin: 0 auto; text-align: center; }
.about-copy p { font-size: 17px; }

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--sp-3);
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0 0 var(--sp-4);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease),
    background-color var(--theme-duration) var(--ease), border-color var(--theme-duration) var(--ease);
}
.feature-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }
.feature-card h3 { margin-bottom: var(--sp-1); }
.feature-card p { font-size: 14.5px; margin: 0; }

/* Photo + overlapping badge. Each card sets --photo-url inline (see
   index.html) to point at its real assets/feature-<name>.jpg; the
   gradient is a second background-image layer, not a fallback swapped
   in by JS, so a missing file just leaves that layer unpainted and the
   gradient still shows underneath — no broken-image icon either way. */
.feature-photo {
  --photo-url: none;
  position: relative;
  aspect-ratio: 4 / 3;
  background-image: var(--photo-url), linear-gradient(135deg, var(--accent-soft), var(--card) 85%);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  margin-bottom: 32px;
}
.feature-badge {
  position: absolute;
  left: 20px;
  bottom: -20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  color: var(--accent-text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--theme-duration) var(--ease), border-color var(--theme-duration) var(--ease);
}
.feature-badge svg { width: 20px; height: 20px; }
.feature-body { padding: 0 var(--sp-4); }

/* How it works — icon timeline */
.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
.timeline::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 48px;
  right: 48px;
  height: 1px;
  background: var(--border);
}
.timeline-step { position: relative; text-align: left; }
.timeline-step .icon-tile {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-2);
}
.timeline-step .step-index {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-text);
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-1);
}
.timeline-step h3 { margin-bottom: 4px; font-size: 16.5px; }
.timeline-step p { font-size: 14px; margin: 0; }

/* ---------- Calculator — clean SaaS dashboard card ---------- */
.calc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-6);
  max-width: 720px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
  transition: background-color var(--theme-duration) var(--ease), border-color var(--theme-duration) var(--ease);
}
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.calc-grid .field:last-child { grid-column: 1 / -1; }
.field { margin-bottom: var(--sp-3); position: relative; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--sp-1); }
.field input, .field select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease),
    background-color var(--theme-duration) var(--ease), color var(--theme-duration) var(--ease);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--card);
}
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: var(--sp-1);
  max-height: 200px;
  overflow-y: auto;
  box-shadow: var(--shadow-card-hover);
}
.suggestion-item { padding: 11px 16px; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--accent-soft); }

.features-list { display: flex; flex-direction: column; gap: 2px; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 14.5px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.checkbox-row:last-child { border-bottom: none; }
.checkbox-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.checkbox-row .surcharge { margin-left: auto; font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }

.calc-card > .btn { width: 100%; margin-top: var(--sp-1); }

.calc-result { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.calc-result-row { display: flex; justify-content: space-between; font-size: 14.5px; padding: 6px 0; }
.calc-result-price { font-size: 19px; padding-top: var(--sp-1); }
.calc-result-price strong { color: var(--accent-text); }
.calc-note { font-size: 12.5px; margin-top: var(--sp-2); }
.calc-error { color: var(--danger); font-size: 13.5px; margin-top: var(--sp-2); font-weight: 500; }

/* ---------- Download — phone mockup, no fake store badges ---------- */
.download-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--sp-10);
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.download-copy h2 { font-size: 32px; }
.download-copy p { font-size: 16.5px; max-width: 420px; margin-bottom: var(--sp-4); }
.download-features { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.download-features li { display: flex; align-items: center; gap: var(--sp-1); font-size: 14.5px; color: var(--text-secondary); }
.download-features svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; }

.phone-mockup {
  position: relative;
  width: 270px;
  margin: 0 auto;
  aspect-ratio: 9 / 19.5;
  /* --primary, not --surface-inverse: the bezel needs to contrast
     against the page behind it. --surface-inverse is a fixed dark
     value, and in dark mode the page --bg is that same dark value —
     the bezel disappeared into the page. --primary is the opposite
     tone of --bg in both themes by design, so this always shows a
     phone silhouette (unchanged dark bezel in light mode; a light
     bezel around the dark --bg screen in dark mode). */
  background: var(--primary);
  border-radius: 40px;
  padding: 10px;
  box-shadow: var(--shadow-card-hover), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
  transition: background-color var(--theme-duration) var(--ease);
}
.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 22px;
  background: var(--primary);
  border-radius: 0 0 14px 14px;
  z-index: 2;
  transition: background-color var(--theme-duration) var(--ease);
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 12px 12px;
  transition: background-color var(--theme-duration) var(--ease);
}

/* Status bar — the one deliberately skeuomorphic touch (Apple-mockup
   signature), everything else below is flat/minimal by contrast. */
.app-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 4px;
}
.app-statusbar-icons { display: inline-flex; align-items: center; gap: 3px; }
.app-statusbar-icons i { display: inline-block; width: 3px; height: 8px; background: var(--text-primary); border-radius: 1px; }
.app-statusbar-icons i:nth-child(1) { height: 5px; align-self: flex-end; }
.app-statusbar-icons i:nth-child(2) { height: 7px; align-self: flex-end; }
.app-statusbar-icons b { display: inline-block; width: 16px; height: 9px; margin-left: 3px; border: 1px solid var(--text-primary); border-radius: 2px; }

.app-header { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 0; }
.app-greeting { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.app-greeting-sub { font-size: 10.5px; color: var(--text-secondary); margin-top: 1px; }
.app-bell {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.app-bell svg { width: 15px; height: 15px; }
.app-bell-dot { position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); border: 1.5px solid var(--card); }

.app-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  /* --card and --bg are close in lightness in dark mode (by design,
     elsewhere on the page a 1px border is enough since cards have
     more room to breathe) — inside this cramped phone screen, that
     wasn't enough on its own to read as a separate card, so add a
     shadow too rather than just relying on the border. */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: background-color var(--theme-duration) var(--ease), border-color var(--theme-duration) var(--ease);
}

.app-card-map { padding: 6px; position: relative; }
.app-map { display: block; width: 100%; height: auto; border-radius: 11px; }
.app-map-tag {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.app-map-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); }

.app-card-eta { padding: 12px 14px; }
.app-eta-value { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1; }
.app-eta-value small { font-size: 10.5px; font-weight: 600; color: var(--text-secondary); margin-left: 4px; }
.app-eta-track { height: 5px; background: var(--border); border-radius: var(--radius-pill); margin: 8px 0 6px; overflow: hidden; }
.app-eta-track span { display: block; height: 100%; width: 64%; background: var(--accent); border-radius: var(--radius-pill); }
.app-eta-route { font-size: 10.5px; color: var(--text-secondary); font-weight: 600; }
.app-eta-route b { color: var(--accent-text); font-weight: 700; margin: 0 2px; }

.app-timeline { position: relative; display: flex; align-items: flex-start; justify-content: space-between; padding: 13px 10px 11px; }
.app-timeline::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 38px;
  right: 38px;
  height: 2px;
  background: var(--border);
}
.app-timeline-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; text-align: center; }
.app-timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-timeline-dot svg { width: 11px; height: 11px; }
.app-timeline-step.is-done .app-timeline-dot { background: var(--success); }
.app-timeline-step.is-current .app-timeline-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.app-timeline-step small { font-size: 8.5px; font-weight: 600; color: var(--text-secondary); line-height: 1.2; }
.app-timeline-step.is-current small { color: var(--text-primary); font-weight: 700; }

.app-card-driver { padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.app-driver-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-driver-info { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.app-driver-info strong { font-size: 12px; color: var(--text-primary); }
.app-driver-rating { font-size: 10.5px; color: var(--warning); font-weight: 700; }
.app-driver-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-driver-check svg { width: 12px; height: 12px; }

.app-cta {
  margin-top: auto;
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: default;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-inverse); color: #cbd5e1; padding: var(--sp-8) clamp(20px, 4vw, 48px) var(--sp-3); }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid rgba(248, 250, 252, 0.12);
}
.footer-logo { height: 24px; filter: brightness(0) invert(1); }
.footer-contacts { display: flex; flex-direction: column; gap: var(--sp-1); }
.footer-contacts h3 { color: #f8fafc; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.footer-contacts a { color: #94a3b8; text-decoration: none; font-size: 14px; transition: color 0.15s var(--ease); }
.footer-contacts a:hover { color: #fff; }
.footer-copyright { max-width: 1200px; margin: var(--sp-2) auto 0; font-size: 12.5px; color: #64748b; }

/* ---------- Scroll reveal (subtle, respects reduced motion) ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html, body { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Accessibility: visible keyboard focus everywhere ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .site-nav { display: none; }
  .nav-burger { display: block; }
  .header-actions .btn-ghost { display: none; }
  #theme-toggle-desktop { display: none; }
  #theme-toggle-mobile { display: inline-flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 460px; margin: 0 auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero { text-align: center; }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
  .download-inner { grid-template-columns: 1fr; text-align: center; }
  .download-copy p { margin-left: auto; margin-right: auto; }
  .download-features { align-items: center; }
  .download-features li { justify-content: center; }
  .timeline { grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
  .timeline::before { display: none; }
}

@media (max-width: 720px) {
  h2 { font-size: 26px; }
  .calc-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .section { padding: var(--sp-8) 20px; }
  .hero { padding: var(--sp-8) 20px var(--sp-6); }
}

.site-nav.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-2) 20px;
  gap: var(--sp-2);
}

/* ---------- Login modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-card);
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
  box-shadow: var(--shadow-card-hover);
  transition: background-color var(--theme-duration) var(--ease);
}
.modal-close {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
}
.modal-logo { height: 28px; margin-bottom: var(--sp-3); }
.modal-card h2 { font-size: 20px; margin-bottom: 6px; }
.modal-card p { font-size: 14px; margin-bottom: var(--sp-3); }
.modal-step .field { text-align: left; margin-bottom: var(--sp-2); }
.modal-step .btn { width: 100%; }

/* Step transitions: fade + slide between email / OTP / registration.
   .step-leave and .step-enter-from are start states that the plain
   .modal-step transition below animates away from — see showStep() in
   app.js, which adds/removes these on a timer instead of toggling
   `hidden` immediately. */
.modal-step {
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.modal-step.step-leave-forward { opacity: 0; transform: translateX(-14px); }
.modal-step.step-leave-back { opacity: 0; transform: translateX(14px); }
.modal-step.step-enter-forward { opacity: 0; transform: translateX(14px); }
.modal-step.step-enter-back { opacity: 0; transform: translateX(-14px); }
.modal-overlay {
  transition: opacity 0.2s var(--ease);
}
.modal-overlay.overlay-leave { opacity: 0; }

/* Loading spinner shown inside a primary button in place of its label
   while a request is in flight. */
.btn-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -3px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
.modal-link {
  display: block;
  width: 100%;
  margin-top: var(--sp-2);
  background: transparent;
  border: none;
  color: var(--accent-text);
  font-size: 13px;
  cursor: pointer;
}
.modal-error { color: var(--danger); font-size: 13px; margin-top: var(--sp-2); margin-bottom: 0; }
.role-options { display: flex; gap: var(--sp-2); }
.role-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease),
    background-color var(--theme-duration) var(--ease);
}
.role-option span { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.role-option small { font-size: 11.5px; color: var(--text-secondary); }
.role-option:hover { border-color: var(--accent-text); }
.role-option.selected { border-color: var(--accent-text); background: var(--accent-soft); }
.role-option:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.modal-success-icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--sp-2);
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
}
.modal-success-icon svg { width: 28px; height: 28px; }
#login-code {
  text-align: center;
  letter-spacing: 6px;
  font-size: 20px;
  font-family: ui-monospace, monospace;
}
