/* =============================================================================
   MasterClass Car Rental — customer booking site
   =============================================================================
   Same brand as the staff app, lighter register. The app is a dense dark tool
   staff use all day; this is a shopfront a stranger visits once while deciding
   whether to trust us with a deposit, usually on a phone, often outdoors.

   Deliberately minimal: no framework, no build step, no bundle. Customers are
   on Zimbabwean mobile data and every kilobyte is money out of their pocket
   before they have booked anything.
   ========================================================================== */

:root {
  /* Warm neutrals, biased very slightly toward the brand red rather than a
     flat grey, so the ground feels chosen rather than defaulted. */
  --ground: #FAF8F6;
  --surface: #FFFFFF;
  --surface-2: #F3F0EC;
  --ink: #17120F;
  --ink-2: #453C36;
  --muted: #7A716A;
  --border: #E5DFD8;
  --border-firm: #CFC6BC;

  /* Brand. Red is the action colour, matching AppColors.brandAction. */
  --red: #D4322C;
  --red-deep: #A8231D;
  --red-soft: #FBEAE8;
  --on-red: #FFFFFF;

  /* Gold reads as money and premium. Darkened from the app's #D1AA67, which is
     tuned for a near-black ground and turns muddy on white. */
  --gold: #A07A31;
  --gold-soft: #F7F0E0;

  --good: #34776A;
  --good-soft: #E3F0ED;

  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(23,18,15,.05);
  --shadow: 0 2px 4px rgba(23,18,15,.04), 0 12px 28px -20px rgba(23,18,15,.35);
  --shadow-lg: 0 4px 8px rgba(23,18,15,.05), 0 24px 48px -28px rgba(23,18,15,.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #121011;
    --surface: #1B1817;
    --surface-2: #232020;
    --ink: #F2EEEB;
    --ink-2: #C9C1BB;
    --muted: #948B85;
    --border: #302B2A;
    --border-firm: #423B3A;
    --red: #FF5A52;
    --red-deep: #D4322C;
    --red-soft: #2C1917;
    --on-red: #FFFFFF;
    --gold: #D1AA67;
    --gold-soft: #26200F;
    --good: #55B8A8;
    --good-soft: #16241F;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 2px 4px rgba(0,0,0,.4), 0 12px 28px -20px rgba(0,0,0,.9);
    --shadow-lg: 0 4px 8px rgba(0,0,0,.5), 0 24px 48px -28px rgba(0,0,0,1);
  }
}

:root[data-theme="dark"] {
  --ground: #121011;
  --surface: #1B1817;
  --surface-2: #232020;
  --ink: #F2EEEB;
  --ink-2: #C9C1BB;
  --muted: #948B85;
  --border: #302B2A;
  --border-firm: #423B3A;
  --red: #FF5A52;
  --red-deep: #D4322C;
  --red-soft: #2C1917;
  --on-red: #FFFFFF;
  --gold: #D1AA67;
  --gold-soft: #26200F;
  --good: #55B8A8;
  --good-soft: #16241F;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 2px 4px rgba(0,0,0,.4), 0 12px 28px -20px rgba(0,0,0,.9);
  --shadow-lg: 0 4px 8px rgba(0,0,0,.5), 0 24px 48px -28px rgba(0,0,0,1);
}

/* Cross-document transitions.
   Three lines that remove the reason people reach for a single-page app: the
   white flash between pages. Supporting browsers cross-fade index -> book ->
   confirmation; everything else just navigates as before, no polyfill. */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: Oxanium, ui-sans-serif, system-ui, sans-serif;
  text-wrap: balance;
  margin: 0;
  letter-spacing: -.015em;
}

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

a { color: var(--red); text-underline-offset: 3px; }

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

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

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 18px; }
.narrow { max-width: 620px; margin: 0 auto; padding: 0 18px; }

/* ---------- header ---------- */
.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand { display: flex; align-items: center; }
.brand img { height: 30px; width: auto; }
/* The wordmark is black, so it needs the light-ground artwork on a light
   ground and the cream artwork on a dark one. Showing the wrong one puts a
   white box around the logo. */
.brand .on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .on-light { display: none; }
  :root:not([data-theme="light"]) .brand .on-dark { display: block; }
}
:root[data-theme="dark"] .brand .on-light { display: none; }
:root[data-theme="dark"] .brand .on-dark { display: block; }
.site-head nav {
  display: flex;
  gap: 20px;
  font-size: .92rem;
  font-weight: 600;
}
.site-head nav a { color: var(--ink-2); text-decoration: none; }
.site-head nav a:hover { color: var(--red); }

/* ---------- hero ---------- */
.hero {
  padding: 52px 0 34px;
  background:
    radial-gradient(120% 90% at 92% -10%, var(--red-soft) 0%, transparent 62%),
    var(--ground);
}
/* Two columns on a wide screen, one on a phone.
   The photo is deliberately DROPPED below 980px rather than stacked above the
   form. Every fleet photo is a portrait phone snap, so stacking one on mobile
   pushes the date pickers and the CTA below the fold — and mobile is most of
   this audience. A picture is worth less than the button it displaces. */
.hero-grid { display: grid; gap: 40px; align-items: center; }
.hero-copy { min-width: 0; }
.hero-art { display: none; }

@media (min-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
  .hero-art {
    display: block;
    position: relative;
  }
  /* The same red the hero's radial gradient uses, pooled behind the photo so it
     sits in the page rather than on top of it. */
  .hero-art::before {
    content: "";
    position: absolute;
    inset: -14% -10% -18% -12%;
    background: radial-gradient(60% 55% at 55% 42%, var(--red-soft) 0%, transparent 72%);
    filter: blur(6px);
  }
  .hero-art img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  }
}

.hero h1 {
  font-size: clamp(2rem, 6.2vw, 3.15rem);
  font-weight: 800;
  line-height: 1.05;
  max-width: 16ch;
}
.hero .lede {
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 46ch;
  margin-top: 14px;
}
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 22px;
  font-size: .88rem;
  color: var(--muted);
}
.trust span { display: flex; align-items: center; gap: 7px; }
.trust svg { width: 15px; height: 15px; flex: none; color: var(--good); }

/* ---------- search card ---------- */
.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  margin-top: 28px;
}
.search-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 680px) {
  .search-grid { grid-template-columns: 1fr 1fr auto; align-items: end; }
}

.field label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input,
.field select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-firm);
  border-radius: 8px;
  padding: 12px 13px;
  min-height: 48px;
}
.field input:focus, .field select:focus { border-color: var(--red); }
/* "optional" beside a label. Marking the one optional field is clearer than
   marking the required ones, which is most of the form. */
.field .opt {
  font-weight: 400;
  font-size: .78rem;
  color: var(--ink-3, var(--muted));
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.field .err { font-size: .82rem; color: var(--red-deep); margin-top: 5px; display: none; }
.field.invalid .err { display: block; }
.field.invalid input { border-color: var(--red-deep); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  font-weight: 700;
  border-radius: 8px;
  padding: 13px 22px;
  min-height: 48px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--red); color: var(--on-red); }
.btn-primary:hover { background: var(--red-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-firm);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- results ---------- */
.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 40px 0 4px;
}
.results-head h2 { font-size: 1.4rem; font-weight: 700; }
.results-head .count { font-size: .92rem; color: var(--muted); }

.fleet {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-top: 20px;
}
@media (min-width: 640px) { .fleet { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .fleet { grid-template-columns: repeat(3, 1fr); } }

.car {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease;
}
.car:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) {
  .car, .car:hover { transition: none; transform: none; }
}

.car-photo {
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.car-photo img { width: 100%; height: 100%; object-fit: cover; }
/* Placeholder for a vehicle with no photo yet. Uses --muted rather than a
   border colour: a border-weight grey disappears against the dark surface,
   leaving what looks like an empty broken card. */
.car-photo svg { width: 54px; height: 54px; color: var(--muted); opacity: .45; }
/* A real photo fills the frame. object-fit: cover keeps every card the same
   height whatever aspect ratio the phone that took the picture produced —
   without it one portrait shot stretches its row and the grid goes ragged. */
.car-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-body { padding: 16px 17px 18px; display: flex; flex-direction: column; flex: 1; gap: 12px; }
.car-body h3 { font-size: 1.08rem; font-weight: 700; }
.spec { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); }
.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.price .total {
  font-family: Oxanium, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.price .per { font-size: .8rem; color: var(--muted); display: block; }
.deposit {
  font-size: .8rem;
  color: var(--gold);
  font-weight: 700;
  background: var(--gold-soft);
  padding: 4px 9px;
  border-radius: 5px;
  white-space: nowrap;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 54px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-firm);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty h3 { color: var(--ink); font-size: 1.1rem; margin-bottom: 8px; }

/* ---------- steps ---------- */
.steps {
  display: flex;
  gap: 6px;
  margin: 26px 0 30px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.steps li {
  flex: 1;
  list-style: none;
  color: var(--muted);
  padding-top: 9px;
  border-top: 3px solid var(--border);
}
.steps li.done { color: var(--good); border-top-color: var(--good); }
.steps li.now { color: var(--red); border-top-color: var(--red); }

/* ---------- panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.panel h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.panel .sub { font-size: .92rem; color: var(--muted); margin-bottom: 18px; }

.stack { display: flex; flex-direction: column; gap: 15px; }

.summary { background: var(--surface-2); border-radius: 8px; padding: 16px 17px; }
.summary .line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  font-size: .93rem;
}
.summary .line span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.summary .line.total {
  border-top: 1px solid var(--border-firm);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 1.05rem;
  font-weight: 800;
}
.summary .line.due span:last-child { color: var(--gold); }

/* upload */
.drop {
  border: 1px dashed var(--border-firm);
  border-radius: 8px;
  padding: 22px 18px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
}
.drop:hover { border-color: var(--red); }
.drop svg { width: 26px; height: 26px; color: var(--muted); margin-bottom: 6px; }
.drop .title { font-weight: 700; font-size: .95rem; }
.drop .note { font-size: .84rem; color: var(--muted); margin-top: 3px; }
.drop.filled { border-style: solid; border-color: var(--good); background: var(--good-soft); }
.drop.filled svg { color: var(--good); }

/* otp */
/* confirmation */
.done-mark {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--good-soft); color: var(--good);
  display: grid; place-items: center; margin: 0 auto 18px;
}
.done-mark svg { width: 30px; height: 30px; }
.ref {
  font-family: Oxanium, sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--red);
  text-align: center;
  padding: 14px;
  background: var(--red-soft);
  border-radius: 8px;
  margin: 4px 0 18px;
}

.notice {
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  padding: 13px 15px;
  font-size: .9rem;
  color: var(--ink-2);
}
.notice b { color: var(--gold); }

/* ---------- footer ---------- */
.site-foot {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 30px 0 40px;
  font-size: .88rem;
  color: var(--muted);
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--red); }

/* Build credit. Deliberately quiet and on its own line rather than a third
   column: the footer's two existing columns are the customer's business, and a
   supplier's name should not sit level with them competing for the same eye. */
.built-by {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  justify-content: center;
  font-size: .8rem;
  color: var(--muted);
}
.built-by strong { color: var(--ink-2); font-weight: 600; }

/* The staging banner. NOT dead once the API is wired — it is gated on
   API.staging and warns that payment and phone verification are not yet on.
   Remove when API.staging goes false on launch day. */
.mock-banner {
  background: var(--ink);
  color: var(--ground);
  font-size: .82rem;
  text-align: center;
  padding: 7px 16px;
}
.mock-banner b { color: var(--gold); }

/* Waitlist form inside the empty-results state. */
.waitlist-form {
  max-width: 320px;
  margin: 22px auto 0;
  text-align: left;
}
.waitlist-form .hint { text-align: center; }

/* Notices raised by showError(). Fixed to the bottom so it is visible wherever
   the customer has scrolled — a message rendered above the fold is no message
   at all on a long form. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .93rem;
  line-height: 1.45;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.toast[data-kind="error"] {
  background: var(--red);
  color: #fff;
}
.toast[data-kind="info"] {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-firm);
}
