:root {
  --green: #4cb122;
  --green-dark: #3a8a19;
  --ink: #14181a;
  --muted: #6b7680;
  --line: #e4e8ea;
  --bg: #f7f9f7;
  --danger: #c0392b;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(20, 24, 26, 0.06);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(20, 24, 26, 0.03);
}
.topbar h1 { font-size: 17px; margin: 0; flex: 1; }
.topbar .back { color: var(--green-dark); font-weight: 600; cursor: pointer; background: none; border: none; font-size: 15px; padding: 4px 0; }

.brand {
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand .ride { color: var(--green); }

.screen { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 16px; }

.hero {
  text-align: center;
  padding: 40px 20px 20px;
}
.hero .logo { font-size: 26px; margin-bottom: 4px; }
.hero p { color: var(--muted); font-size: 14px; }
.hero-logo { width: 72px; height: 72px; margin-bottom: 10px; }

label { font-size: 13px; font-weight: 600; color: var(--ink); display: block; margin-bottom: 6px; }
.field { margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

input, select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  /* 16px minimum — anything smaller makes iOS Safari zoom the page on focus. */
  font-size: 16px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(76, 177, 34, 0.12); }

button.primary {
  width: 100%;
  padding: 15px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
button.primary:disabled { opacity: 0.45; cursor: default; }
button.primary.green { background: var(--green); }
button.primary:not(:disabled):active { transform: scale(0.98); opacity: 0.92; }

button.ghost {
  width: 100%;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}
button.ghost:active { transform: scale(0.98); background: var(--bg); }

.error-banner {
  background: #fdecea;
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(20, 24, 26, 0.04);
}
.card + .card { margin-top: 0; }

.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  box-shadow: 0 1px 3px rgba(20, 24, 26, 0.04);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.tile:active { background: #f2f5f2; transform: scale(0.99); box-shadow: 0 1px 2px rgba(20, 24, 26, 0.03); }
.tile .icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: #eef7ea; color: var(--green-dark); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tile .title { font-weight: 700; font-size: 15.5px; }
.tile .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.fare-banner {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 14px rgba(20, 24, 26, 0.16);
}
.fare-banner .amount { font-size: 22px; font-weight: 800; }
.fare-banner .label { font-size: 12px; opacity: 0.75; }

.status-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-confirmed, .status-enquiry { background: #eef2fb; color: #3355a8; }
.status-assigned, .status-en_route, .status-arrived, .status-in_progress { background: #fff3d9; color: #8a5a00; }
.status-completed { background: #eaf7e6; color: var(--green-dark); }
.status-cancelled, .status-no_show { background: #fdecea; color: var(--danger); }

.timeline { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.timeline .step { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.timeline .step.done { color: var(--ink); font-weight: 600; }
.timeline .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.timeline .step.done .dot { background: var(--green); }

.pin-box {
  text-align: center;
  padding: 14px;
  background: var(--bg);
  border-radius: 12px;
}
.pin-box .pin { font-size: 28px; font-weight: 800; letter-spacing: 0.15em; }

.driver-card { display: flex; gap: 12px; align-items: center; }
.driver-card .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; flex-shrink: 0;
}

.history-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.history-row:last-child { border-bottom: none; }

.tabbar {
  display: flex;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: #fff;
  box-shadow: 0 -2px 10px rgba(20, 24, 26, 0.05);
}
.tabbar button {
  flex: 1; padding: 12px 0; background: none; border: none; font-size: 12px;
  color: var(--muted); font-weight: 600; cursor: pointer;
  transition: color 0.15s ease;
}
.tabbar button.active { color: var(--green-dark); }
.tabbar .tab-icon { display: flex; justify-content: center; margin-bottom: 2px; }

.inline-icon { display: inline-flex; vertical-align: -3px; margin-right: 4px; }

.suggestions {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: -10px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(20, 24, 26, 0.08);
}
.suggestions button {
  display: block; width: 100%; text-align: left; padding: 10px 14px;
  background: #fff; border: none; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer;
}
.suggestions button:last-child { border-bottom: none; }
.suggestions button:hover { background: var(--bg); }

.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff; border-radius: 50%; display: inline-block;
  animation: spin 0.7s linear infinite; vertical-align: -3px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* --- Offline banner -------------------------------------------------------
   Pinned to the top so it is visible on whatever screen the user is on. The
   point is that they never wonder whether a tap registered or the network
   ate it. */
.offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 10px 14px calc(10px + env(safe-area-inset-top, 0px));
  transform: translateY(-100%);
  transition: transform .25s ease;
}
.offline-banner.on { transform: translateY(0); }

/* --- Danger zone (account deletion) --------------------------------------
   Visually separated and red so it can't be confused with a normal action,
   but still easy to find — Apple guideline 5.1.1(v) requires deletion to be
   discoverable, not hidden. */
.danger-zone {
  margin-top: 32px;
  padding: 18px;
  border: 1px solid #f0c9c4;
  border-radius: var(--radius);
  background: #fdf6f5;
}
.danger-zone h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--danger);
}
.danger-zone p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; }
button.primary.danger { background: var(--danger); margin-top: 6px; }

/* Suggestion rows carry a second line when the result came from Google
   ("Aminu Kano Crescent, Wuse 2") — the name alone is often ambiguous. */
.suggestions button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.sug-name { font-weight: 600; }
.sug-sub { font-size: 12.5px; color: var(--muted); }


/* ==========================================================================
   REAL-DEVICE FIXES (7 Aug 2026)
   Issues that only show up on an actual phone, not in a desktop browser.
   ========================================================================== */

/* 1. iOS Safari zooms the whole page whenever a focused input has a font
      smaller than 16px. The rider then has to pinch back out mid-booking.
      16px is the minimum that prevents it — this is not a style choice. */
input, select, textarea { font-size: 16px; }

/* 2. On iPhones with a home indicator (X and later) the bottom tab bar sits
      underneath it, so the bottom few pixels of each button aren't tappable.
      Pad by the safe area the device reports. */
.tabbar {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* 3. 100vh on mobile means "viewport with the URL bar hidden", so content is
      taller than the visible area and jumps as the bar collapses. dvh is the
      dynamic viewport height; the 100vh line stays first as a fallback for
      older browsers. */
.app { min-height: 100vh; min-height: 100dvh; }

/* 4. Tap targets. Apple's guideline is 44pt, Google's 48dp. The tab buttons
      were ~40px, which is the difference between a confident tap and a
      missed one for someone in a moving car. */
.tabbar button { min-height: 48px; }
button, .suggestions button { min-height: 44px; }

/* 5. Suppress the grey/blue flash iOS and Android draw over tapped elements —
      we already have our own :active states. */
* { -webkit-tap-highlight-color: transparent; }

/* 6. Stop the whole page rubber-banding when a scrollable list hits its end,
      which on iOS makes the app feel like a web page rather than an app. */
body { overscroll-behavior-y: none; }

/* 7. Long place names and email addresses must wrap rather than force the
      layout wider than the screen — a horizontal scrollbar on a 320px
      phone breaks every screen at once. */
body { overflow-x: hidden; }
.sug-name, .sug-sub, .card { overflow-wrap: anywhere; }

/* --- Flight card ----------------------------------------------------------
   The rider-facing proof that "we track your flight, not the clock" is real.
   A simulated-data notice is shown whenever the backend says the status did
   not come from a live provider. */
.flight-card { border-left: 3px solid var(--green); }
.flight-head { display: flex; justify-content: space-between; align-items: flex-start; }
.flight-no { font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.flight-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.flight-ok { background: rgba(76,177,34,.12); color: var(--green-dark); }
.flight-bad { background: rgba(192,57,43,.12); color: var(--danger); }
.flight-muted { background: var(--bg); color: var(--muted); }
.flight-times { display: flex; gap: 14px; margin-top: 14px; font-size: 14px; }
.flight-times > div { flex: 1; }
.flight-times s { color: var(--muted); font-size: 12.5px; }
.flight-msg { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.flight-sim {
  margin: 10px 0 0; font-size: 12px; font-weight: 600; color: #8a6d00;
  background: #fff8e1; border-radius: 8px; padding: 8px 10px;
}


/* The coming-soon screen uses an <a> for its main action so it can carry an
   href to WhatsApp. The button styles are element-scoped (button.primary),
   so an anchor got none of them and rendered as a plain blue link. */
a.primary {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 15px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  min-height: 44px;
  box-sizing: border-box;
}
a.primary.green { background: var(--green); color: #fff; }
a.primary:active { opacity: .92; }
