/* ============================================================
   FamTravel — design system
   ============================================================ */

:root {
  --navy-900: #0c1730;
  --navy-800: #122044;
  --navy-700: #1d2f57;
  --coral-500: #ff6b4a;
  --coral-400: #ff8a5c;
  --coral-700: #c2401d; /* AA on white */
  --teal-600: #0e7c86;

  /* CTA fills carry white text, so they must clear 4.5:1 in both themes.
     Kept theme-stable (unlike --coral-700, which flips light in dark mode). */
  --cta: #c2401d;        /* white text = 5.19:1 */
  --cta-hover: #a83518;  /* white text = 6.7:1  */
  --cta-shadow: rgba(194, 64, 29, 0.35);

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --ink: #11203c;
  --muted: #56657f;
  --line: #dfe5f0;
  --shadow: 0 10px 30px rgba(13, 25, 51, 0.08);
  --shadow-lg: 0 24px 60px rgba(13, 25, 51, 0.16);

  /* Semantic state colors — text shades clear 4.5:1 on their bg in both themes. */
  --success: #176442;      --success-bg: #e3f4ec;
  --info: #2b4eb3;         --info-bg: #e8efff;
  --warning: #7a5d00;      --warning-bg: #fff3cd;
  --danger: #c0392b;       --danger-bg: #fdebe5;

  /* Focus ring — must clear 3:1 against the surface (WCAG 1.4.11). */
  --focus-ring: #c2401d;

  /* Type scale (fluid, ~1.2 ratio). One named ramp instead of ad-hoc sizes. */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: clamp(1.05rem, 1.2vw, 1.15rem);
  --text-lg: clamp(1.2rem, 1.6vw, 1.35rem);
  --text-xl: clamp(1.5rem, 3vw, 2rem);
  --text-2xl: clamp(1.6rem, 3.4vw, 2.3rem);
  --text-3xl: clamp(2.1rem, 5vw, 3.4rem);

  /* Font weights */
  --fw-normal: 400; --fw-medium: 600; --fw-semibold: 700; --fw-bold: 800; --fw-black: 850;

  /* Spacing scale (4px base) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 56px;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Motion */
  --dur-fast: 0.12s;
  --dur-base: 0.2s;
  --dur-slow: 0.35s;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1.2);

  --header-h: 64px;
  --tabbar-h: 62px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1228;
    --surface: #121d3a;
    --surface-2: #1a2746;
    --ink: #edf1f9;
    --muted: #9aa7c4;
    --line: #25345c;
    --coral-700: #ff8a5c; /* readable on dark */
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);

    /* Semantic colors retuned for dark surfaces (text shades lightened to keep 4.5:1). */
    --success: #7fd6a8;      --success-bg: #143d2c;
    --info: #9db4f5;         --info-bg: #1b2c57;
    --warning: #ffd966;      --warning-bg: #3d3000;
    --danger: #ff8a73;       --danger-bg: #43210f;

    --focus-ring: #ff8a5c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

img, svg { vertical-align: middle; }

a { color: var(--coral-700); }

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--navy-900); color: #fff;
  padding: 10px 18px; border-radius: 0 0 12px 12px;
  z-index: 100; transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

/* ------------------------------------------------------------
   Header & navigation
   ------------------------------------------------------------ */

.app-header {
  position: sticky; top: 0; z-index: 40;
  /* Extend under the iOS status bar (viewport-fit=cover + black-translucent)
     and pad the content back down out of the notch / Dynamic Island. */
  min-height: var(--header-h);
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; gap: 20px;
  padding-inline: clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.brand-logo { width: 34px; height: 34px; border-radius: 9px; }
.brand .tld { color: var(--coral-500); }

.nav-desktop { display: none; gap: 4px; margin-left: 8px; }
.nav-desktop a {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.95rem;
  padding: 8px 14px; border-radius: 999px;
}
.nav-desktop a:hover { color: var(--ink); background: var(--surface-2); }
.nav-desktop a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.net-pill {
  display: none; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: var(--warning-bg); color: var(--warning);
}
.net-pill.show { display: inline-flex; }

@media (min-width: 880px) {
  .nav-desktop { display: flex; }
}
@media (max-width: 879px) {
  /* The tab bar and hero CTA cover booking on small screens */
  #headerBookBtn { display: none; }
}

/* Bottom tab bar (mobile app chrome) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 0.68rem; font-weight: 700;
}
.tab-item svg { width: 23px; height: 23px; }
.tab-item[aria-current="page"] { color: var(--coral-700); }

@media (min-width: 880px) {
  .tabbar { display: none; }
  body { padding-bottom: 0; }
}

main { display: block; min-height: calc(100vh - var(--header-h)); }
@media (max-width: 879px) {
  main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); }
}

/* ------------------------------------------------------------
   Buttons, chips, badges
   ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 0.98rem;
  padding: 12px 24px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; transition: transform 0.06s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--cta); color: #fff; box-shadow: 0 8px 20px var(--cta-shadow); }
.btn-primary:hover { background: var(--cta-hover); }

.btn-navy { background: var(--navy-800); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }

.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-sm { padding: 8px 16px; font-size: 0.88rem; min-height: 36px; }
.btn-block { width: 100%; }

.btn-link {
  background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--coral-700); font: inherit; font-weight: 700; text-decoration: underline;
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.badge-faa { background: var(--success-bg); color: var(--success); }
.badge-soft { background: var(--surface-2); color: var(--muted); }
.badge-warn { background: var(--danger-bg); color: var(--danger); }

.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}
.status-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-chip.live { background: var(--success-bg); color: var(--success); }
.status-chip.upcoming { background: var(--info-bg); color: var(--info); }
.status-chip.done { background: var(--surface-2); color: var(--muted); }

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */

.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(255, 107, 74, 0.18), transparent 60%),
    linear-gradient(180deg, var(--navy-700), var(--navy-900) 70%);
  color: #eef1f7;
  padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 40px) clamp(56px, 8vw, 104px);
}
.hero-inner {
  max-width: 1080px; margin: 0 auto;
  display: grid; gap: 48px; align-items: center;
}
@media (min-width: 920px) {
  .hero-inner { grid-template-columns: 1.1fr 0.9fr; }
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--coral-400); margin-bottom: 18px;
}
.hero-title {
  font-size: var(--text-3xl);
  line-height: 1.08; letter-spacing: -0.02em; font-weight: 850; margin: 0 0 18px;
}
.hero-title em { font-style: normal; color: var(--coral-400); }
.hero-sub {
  font-size: clamp(1.02rem, 2vw, 1.18rem); color: #b9c4dc; max-width: 54ch; margin: 0 0 30px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }

.stat-row { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 44px); }
.stat .num { font-size: 1.5rem; font-weight: 850; letter-spacing: -0.01em; }
.stat .lbl { font-size: 0.82rem; color: #93a1bf; font-weight: 600; }

/* Hero visual: the journey card */
.hero-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 26px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-lg);
}
.hero-card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.hero-card .sub { color: #93a1bf; font-size: 0.85rem; margin: 0 0 18px; }
.route-svg { width: 100%; height: auto; display: block; }

.journey-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.journey-steps li {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 0.92rem; color: #c8d2e8;
}
.journey-steps .dot {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 138, 92, 0.18); color: var(--coral-400);
  display: grid; place-items: center; font-size: 0.78rem; font-weight: 800;
  margin-top: 1px;
}

@media (prefers-reduced-motion: no-preference) {
  .route-dash { stroke-dasharray: 8 10; animation: dashmove 2.6s linear infinite; }
  @keyframes dashmove { to { stroke-dashoffset: -36; } }
}

/* ------------------------------------------------------------
   Landing sections
   ------------------------------------------------------------ */

.section { padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 40px); }
.section-inner { max-width: 1080px; margin: 0 auto; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }

.eyebrow {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--coral-700); margin: 0 0 10px;
}
.section-title {
  font-size: var(--text-2xl); font-weight: var(--fw-black); letter-spacing: -0.02em;
  margin: 0 0 12px; line-height: 1.15;
}
.section-sub { color: var(--muted); max-width: 62ch; margin: 0 0 40px; font-size: 1.04rem; }

.steps-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }

.step-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); position: relative;
}
.section-alt .step-card { background: var(--bg); }
.step-num {
  position: absolute; top: 18px; right: 20px;
  font-size: 2rem; font-weight: 850; color: var(--line); line-height: 1;
}
.step-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--surface-2); color: var(--coral-700);
  display: grid; place-items: center; margin-bottom: 14px;
}
.step-icon svg { width: 24px; height: 24px; }
.step-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step-card p { margin: 0; color: var(--muted); font-size: 0.93rem; }

.leg-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 0.9rem; letter-spacing: 0.02em;
  margin: 36px 0 14px;
}
.leg-label:first-of-type { margin-top: 0; }
.leg-label .line { flex: 1; height: 1px; background: var(--line); min-width: 40px; }

.props-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .props-grid { grid-template-columns: repeat(3, 1fr); } }
.prop-card { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.prop-card h3 { margin: 8px 0 6px; font-size: 1rem; }
.prop-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Car seats */
.seat-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .seat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .seat-grid { grid-template-columns: repeat(4, 1fr); } }

.seat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
}
.seat-card .seat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.seat-card h3 { margin: 0; font-size: 1.02rem; }
.seat-card .range { color: var(--muted); font-size: 0.84rem; font-weight: 600; }
.seat-card p { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }
.seat-card .price { font-weight: 850; font-size: 1.1rem; }
.seat-card .price small { color: var(--muted); font-weight: 600; }

/* Pricing */
.price-grid { display: grid; gap: 18px; align-items: stretch; }
@media (min-width: 880px) { .price-grid { grid-template-columns: repeat(3, 1fr); } }
.price-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow);
}
.price-card.featured {
  border: 2px solid var(--coral-500);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.price-card .plan { font-weight: 800; font-size: 0.95rem; }
.price-amount { font-size: 2.2rem; font-weight: 850; letter-spacing: -0.02em; }
.price-amount small { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.price-note { color: var(--muted); font-size: 0.88rem; margin: 0 0 12px; }
.price-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 9px; flex: 1; }
.price-list li { display: flex; gap: 9px; font-size: 0.92rem; color: var(--muted); }
.price-list li::before { content: "✓"; color: var(--teal-600); font-weight: 800; }
.tag-popular {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--cta); color: #fff; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 14px; border-radius: 999px;
}

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 4px 20px;
}
.faq-item summary {
  cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--coral-700); flex: none; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 16px; color: var(--muted); font-size: 0.95rem; }

/* Install banner */
.install-cta {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
  background: linear-gradient(120deg, var(--navy-800), var(--navy-900));
  color: #eef1f7; border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 40px);
}
.install-cta h2 { margin: 0 0 6px; font-size: 1.3rem; }
.install-cta p { margin: 0; color: #9fadc9; font-size: 0.95rem; max-width: 52ch; }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 36px clamp(16px, 4vw, 40px) 48px; color: var(--muted); font-size: 0.88rem;
}
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center;
}
.footer a { color: var(--muted); }

/* ------------------------------------------------------------
   App pages (book / trips / seats / account)
   ------------------------------------------------------------ */

.page { max-width: 720px; margin: 0 auto; padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 24px) 64px; }
.page-wide { max-width: 1080px; }
.page-title { font-size: var(--text-xl); font-weight: var(--fw-black); letter-spacing: -0.02em; margin: 0 0 6px; }
.page-sub { color: var(--muted); margin: 0 0 28px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card h2 { font-size: 1.1rem; margin: 0 0 16px; }
.card h3 { font-size: 0.98rem; margin: 0 0 10px; }

/* Forms */
.form-grid { display: grid; gap: 16px; }
@media (min-width: 560px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field > label { font-weight: 700; font-size: 0.88rem; }
.field .hint { font-size: 0.8rem; color: var(--muted); }
.field-error { font-size: 0.8rem; color: var(--danger); font-weight: 600; display: none; }
.field.invalid .field-error { display: block; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="time"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 14px; width: 100%; min-height: 46px;
  transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}
/* Keep the border highlight, but also show a real focus ring (the old rule
   suppressed the outline entirely — an a11y gap on every text field). */
input:focus, select:focus, textarea:focus { border-color: var(--cta); outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--cta);
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

input[type="range"] { width: 100%; accent-color: var(--cta); }

.radio-cards { display: grid; gap: 10px; }
@media (min-width: 560px) { .radio-cards { grid-template-columns: 1fr 1fr; } }
.radio-card {
  position: relative; display: block; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; background: var(--surface);
}
.radio-card input { position: absolute; opacity: 0; }
.radio-card .t { font-weight: 700; font-size: 0.95rem; display: block; }
.radio-card .d { color: var(--muted); font-size: 0.84rem; }
.radio-card:has(input:checked) { border-color: var(--coral-500); background: color-mix(in srgb, var(--coral-500) 6%, var(--surface)); }
.radio-card:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* Toggle switch */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch-row .lbl { font-weight: 700; }
.switch-row .sub { color: var(--muted); font-size: 0.85rem; }
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--line);
  transition: background 0.15s ease; pointer-events: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 0.15s ease;
}
.switch input:checked + .track { background: var(--teal-600); }
.switch input:checked + .track::after { transform: translateX(22px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* Quantity stepper */
.qty-stepper { display: inline-flex; align-items: center; gap: 0; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty-stepper button {
  font: inherit; font-weight: 800; font-size: 1.1rem; border: 0; background: var(--surface-2);
  width: 40px; height: 38px; cursor: pointer; color: var(--ink);
}
.qty-stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-stepper .qty { width: 40px; text-align: center; font-weight: 800; }

/* Wizard */
.wizard-progress { display: flex; align-items: center; gap: 6px; margin: 0 0 24px; }
.wizard-progress .seg { height: 6px; border-radius: 999px; flex: 1; background: var(--line); }
.wizard-progress .seg.done { background: var(--coral-500); }
.wizard-step-label { font-size: 0.8rem; font-weight: 800; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* Live fare estimator — sticky just above the bottom controls so the running
   total is always glanceable while filling the form. */
.fare-bar {
  /* Stick above the bottom controls; clear the mobile tab bar. */
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: var(--space-5); padding: 12px 18px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 880px) { .fare-bar { bottom: 12px; } }
.fare-bar-main { display: flex; flex-direction: column; gap: 1px; }
.fare-bar-label { font-size: var(--text-xs); color: var(--muted); font-weight: var(--fw-medium); }
.fare-bar-total { font-size: var(--text-lg); font-weight: var(--fw-black); letter-spacing: -0.01em; }

/* Callout — reassuring inline note (e.g. the flight-aware "leave home by"). */
.callout {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.callout-accent { background: var(--info-bg); border-color: transparent; }
.callout-icon { width: 22px; height: 22px; flex: none; color: var(--info); }
.callout-body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.callout-body strong { font-size: 0.95rem; color: var(--info); }
.callout-sub { font-size: 0.8rem; color: var(--muted); }

.flight-hint.ok { color: var(--success); font-weight: var(--fw-medium); }

/* Summary / receipt */
.summary-table { display: grid; gap: 10px; }
.line-item { display: flex; justify-content: space-between; gap: 16px; font-size: 0.95rem; }
.line-item .l { color: var(--muted); }
.line-item .v { font-weight: 700; white-space: nowrap; }
.total-row {
  display: flex; justify-content: space-between; border-top: 1.5px solid var(--line);
  padding-top: 12px; margin-top: 4px; font-weight: 850; font-size: 1.15rem;
}
.fine { font-size: 0.78rem; color: var(--muted); }

/* Live tracker */
.track-card { background: linear-gradient(180deg, var(--navy-800), var(--navy-900)); color: #eef1f7; border: 0; }
.track-card h2 { color: #fff; }
.track-map-wrap { margin: 18px 0 4px; }
.track-map { width: 100%; height: auto; display: block; overflow: visible; }
.track-route { stroke: rgba(255,255,255,0.16); stroke-width: 5; stroke-linecap: round; }
.track-progress { stroke: var(--coral-400); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset var(--dur-slow) var(--ease-standard); }
.track-node { fill: rgba(255,255,255,0.12); }
.track-home, .track-airport { color: #fff; }
.track-marker { transition: transform 1.1s var(--ease-standard); color: var(--coral-400); }
.track-dot { fill: var(--coral-400); stroke: #fff; stroke-width: 2; }
.track-pulse { fill: var(--coral-400); opacity: 0.35; }
@media (prefers-reduced-motion: no-preference) {
  .track-pulse { animation: trackPulse 1.8s ease-out infinite; transform-origin: center; }
  @keyframes trackPulse { 0% { transform: scale(0.6); opacity: 0.5; } 100% { transform: scale(2.2); opacity: 0; } }
}
.track-ends { display: flex; justify-content: space-between; font-size: var(--text-xs); color: #9fb0cf; font-weight: 700; margin-top: 2px; }
.track-status { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.track-head { font-size: var(--text-md); font-weight: var(--fw-bold); color: #fff; }
.track-sub { color: #9fb0cf; font-size: var(--text-sm); }
.track-card .status-chip { background: rgba(255,255,255,0.12); color: #fff; }
.track-controls { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.track-controls .fine { color: #8595b5; margin-left: auto; }
.track-card .btn-ghost { color: #eef1f7; border-color: rgba(255,255,255,0.3); }
.track-card .btn-ghost:hover { background: rgba(255,255,255,0.08); }

/* Photo proof */
.track-photo { margin-top: 16px; }
.photo-proof {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-sm); padding: 10px; cursor: pointer; color: inherit;
}
.photo-proof:hover { background: rgba(255,255,255,0.12); }
.photo-proof-img { width: 110px; height: 52px; border-radius: 8px; flex: none; }
.photo-proof-cap { display: flex; flex-direction: column; gap: 2px; font-size: var(--text-sm); }
.photo-proof-cap strong { color: #fff; }
.photo-proof-cap .muted { color: #9fb0cf; font-size: var(--text-xs); }
.modal .photo-proof { background: var(--surface-2); border-color: var(--line); }
.modal .photo-proof-cap strong { color: var(--ink); }
.modal .photo-proof-cap .muted { color: var(--muted); }
/* Photo-proof illustration palette */
.pp-sky { fill: #cfe0f5; } .pp-ground { fill: #b8c8a8; } .pp-drive { fill: #9aa6b4; }
.pp-house { fill: #f0f3f9; } .pp-door { fill: var(--cta); } .pp-car { fill: var(--navy-700); }
.pp-wheel { fill: #20304f; } .pp-sun { fill: #ffd27a; }

/* Trips */
.trip-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.trip-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.trip-card + .trip-card { margin-top: 12px; }
.trip-card .row1 { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.trip-card .airport { font-weight: 850; font-size: 1.15rem; letter-spacing: -0.01em; }
.trip-card .meta { color: var(--muted); font-size: 0.88rem; }

.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 22px 34px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .t-dot {
  position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--line); display: grid; place-items: center;
}
.timeline li:not(:last-child)::after {
  content: ""; position: absolute; left: 9px; top: 24px; bottom: 2px; width: 2px; background: var(--line);
}
.timeline li.done .t-dot { border-color: var(--teal-600); background: var(--teal-600); }
.timeline li.done .t-dot::after { content: "✓"; color: #fff; font-size: 0.6rem; font-weight: 900; }
.timeline li.done:not(:last-child)::after { background: var(--teal-600); }
.timeline li.current .t-dot { border-color: var(--coral-500); }
.timeline li.current .t-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--coral-500);
}
@media (prefers-reduced-motion: no-preference) {
  .timeline li.current .t-dot::before { animation: pulse 1.4s ease infinite; }
  @keyframes pulse { 50% { transform: scale(1.5); opacity: 0.6; } }
}
.timeline .t-title { font-weight: 700; font-size: 0.95rem; }
.timeline li.current .t-title { color: var(--coral-700); }
.timeline .t-time { color: var(--muted); font-size: 0.8rem; }
.timeline .t-desc { color: var(--muted); font-size: 0.86rem; }

.empty-state {
  text-align: center; padding: 56px 24px; color: var(--muted);
  background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius);
}
.empty-state .big { font-size: 2.4rem; margin-bottom: 8px; }
.empty-state h2 { color: var(--ink); font-size: 1.15rem; margin: 0 0 6px; }
.empty-state p { margin: 0 0 20px; }

/* Confirmation */
.confirm-hero { text-align: center; padding: 16px 0 8px; }
.confirm-hero .ring {
  width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--success-bg); color: var(--success); display: grid; place-items: center; font-size: 2rem;
}

/* ------------------------------------------------------------
   Toasts & modals
   ------------------------------------------------------------ */

.toast-region {
  position: fixed; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  left: 50%; transform: translateX(-50%); z-index: 80;
  display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
@media (min-width: 880px) { .toast-region { bottom: 24px; } }
.toast {
  pointer-events: auto;
  background: var(--navy-800); color: #eef1f7; border-radius: 14px;
  padding: 13px 18px; font-size: 0.92rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
}
.toast .btn-link { color: var(--coral-400); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.25s ease; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
}

.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(8, 13, 28, 0.6);
  display: grid; place-items: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); padding: 28px;
  width: min(94vw, 480px); max-height: 86vh; overflow: auto; box-shadow: var(--shadow-lg);
}
.modal h2 { margin: 0 0 10px; font-size: 1.2rem; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ------------------------------------------------------------
   Utilities
   ------------------------------------------------------------ */

.muted { color: var(--muted); }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------
   View Transitions — a calm cross-fade between routes (progressive
   enhancement; only fires where supported and motion is allowed).
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: var(--dur-base);
    animation-timing-function: var(--ease-standard);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* Skip the view-transition animation entirely. */
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
