/* Tiyende shared styles (rider app, driver app, tracking page).
   Look: deep Copperbelt green with copper orange, built for phones in bright sunlight.
   System fonts on purpose: no font downloads on mobile data. */
:root {
  --green: #0b5d3b; --green-2: #0f7a4d; --green-ink: #06331f;
  --copper: #d9721c; --copper-2: #b85d12; --copper-soft: #fbe7d3;
  --ink: #15201a; --muted: #5b6b62; --line: #dde3dc; --bg: #f5f3ee; --surface: #ffffff; --soft: #eef2ec;
  --ok: #138a4a; --warn: #b26a00; --err: #c4352b; --err-soft: #fde8e6;
  --plate: #f7d23a;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 14px; --shadow: 0 10px 30px rgba(10, 30, 20, .16);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ink: #e8efe9; --muted: #9db0a5; --line: #2a3a31; --bg: #0e1612; --surface: #16211b; --soft: #1c2a22;
  --green: #2fae6f; --green-2: #3cc47f; --green-ink: #0b2a1a; --copper: #f0954a; --copper-2: #e07b2a; --copper-soft: #3a2615; --err-soft: #3a1714;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --ink: #e8efe9; --muted: #9db0a5; --line: #2a3a31; --bg: #0e1612; --surface: #16211b; --soft: #1c2a22;
  --green: #2fae6f; --green-2: #3cc47f; --green-ink: #0b2a1a; --copper: #f0954a; --copper-2: #e07b2a; --copper-soft: #3a2615; --err-soft: #3a1714;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; font: 16px/1.45 var(--font); color: var(--ink); background: var(--bg); overscroll-behavior: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 800; } h2 { font-size: 1.3rem; font-weight: 800; } h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--green); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .center { text-align: center; }
.stack { display: grid; gap: 12px; } .stack-s { display: grid; gap: 6px; } .row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.money { font-variant-numeric: tabular-nums; font-weight: 800; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 12px; border: 0;
  font: 700 1.02rem var(--font); cursor: pointer; background: var(--green); color: #fff; text-decoration: none; width: 100%; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.copper { background: var(--copper); color: #1d0f02; }
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.danger { background: var(--err); color: #fff; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .92rem; width: auto; }
.btn.icon { width: 48px; min-height: 48px; padding: 0; border-radius: 50%; flex: none; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* forms */
label { font-weight: 650; font-size: .92rem; }
.field { display: grid; gap: 6px; }
input, select, textarea { font: 1rem var(--font); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; width: 100%; min-height: 50px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.hint { font-size: .85rem; color: var(--muted); }
.error { color: var(--err); font-weight: 600; font-size: .92rem; }
.phone-input { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.phone-input span { display: grid; place-items: center; padding: 0 12px; background: var(--soft); font-weight: 700; }
.phone-input input { border: 0; border-radius: 0; }
.code-input { font: 800 1.8rem var(--mono); letter-spacing: .4em; text-align: center; }

/* cards and choices */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; border: 1px solid var(--line); }
.choice { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; }
.choice[aria-pressed="true"], .choice[aria-checked="true"] { border-color: var(--green); background: color-mix(in srgb, var(--green) 7%, var(--surface)); }
.choice:disabled { opacity: .5; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: 650 .92rem var(--font); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* Zambian number plate: yellow plate, black lettering */
.plate { display: inline-block; font: 800 1.15rem/1 var(--mono); letter-spacing: .08em; color: #111; background: var(--plate); border: 2px solid #111;
  border-radius: 6px; padding: 6px 10px; white-space: nowrap; }
.plate.big { font-size: 1.5rem; padding: 8px 14px; }
.vehicle-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); vertical-align: -2px; margin-right: 4px; }
.tag { display: inline-block; font: 700 .72rem var(--font); letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: var(--soft); color: var(--ink); }
.tag.green { background: var(--green); color: #fff; } .tag.copper { background: var(--copper); color: #1d0f02; } .tag.err { background: var(--err); color: #fff; }

/* full-screen map layout with a bottom sheet */
.app { position: fixed; inset: 0; display: grid; grid-template-rows: 1fr; }
#map { position: absolute; inset: 0; background: #dfe6dd; z-index: 0; }
.topbar { position: absolute; z-index: 5; top: calc(10px + env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  display: flex; gap: 8px; align-items: center; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.fab { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fab.sos { background: var(--err); color: #fff; font: 800 .8rem var(--font); }
.brandpill { background: var(--surface); box-shadow: var(--shadow); border-radius: 999px; padding: 10px 16px; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.brandpill i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--copper); }
.sheet { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow-y: auto; background: var(--surface); color: var(--ink);
  border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.18);
  padding: 10px max(16px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
@media (min-width: 760px) { .sheet { left: 16px; right: auto; width: 420px; bottom: 16px; border-radius: 22px; max-height: calc(100vh - 100px); } }
.screen { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto;
  padding: calc(20px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.screen > .inner { max-width: 480px; margin: 0 auto; display: grid; gap: 18px; }
.backrow { display: flex; align-items: center; gap: 10px; }
.list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.list > * { padding: 14px 0; border-bottom: 1px solid var(--line); }
.suggest { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.suggest b { display: block; } .suggest span { color: var(--muted); font-size: .88rem; }
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--green); }
.dot.sq { border-radius: 3px; background: var(--copper); }
.route-box { display: grid; grid-template-columns: 14px 1fr; gap: 6px 12px; align-items: center; }
.route-box .line { width: 2px; height: 16px; background: var(--line); margin-left: 5px; }

/* banners and toasts */
.banner { padding: 12px 14px; border-radius: 12px; background: var(--copper-soft); color: var(--ink); font-size: .92rem; }
.banner.err { background: var(--err-soft); } .banner.ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.testbar { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); top: env(safe-area-inset-top, 0px); background: var(--copper); color: #1d0f02; font: 700 .72rem var(--font); letter-spacing: .05em; padding: 3px 10px; border-radius: 0 0 8px 8px; }
#toast { position: fixed; z-index: 60; left: 50%; top: calc(72px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface);
  padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: var(--shadow); }

/* stars */
.stars { display: flex; gap: 6px; justify-content: center; }
.stars button { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--line); }
.stars button svg { width: 40px; height: 40px; fill: currentColor; }
.stars button[aria-pressed="true"] { color: #f2b51b; }

/* searching pulse */
.pulse { width: 74px; height: 74px; border-radius: 50%; background: var(--green); margin: 8px auto; position: relative; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--green); animation: ping 1.6s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: .8; } to { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse::after { animation: none; } }

/* map markers */
.mk { width: 22px; height: 22px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.mk.pick { background: var(--green); } .mk.drop { background: var(--copper); border-radius: 5px; }
.mk.me { background: #2a7de1; }
.car { width: 38px; height: 38px; display: grid; place-items: center; }
.car svg { width: 38px; height: 38px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.centerpin { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -100%); pointer-events: none; }
.centerpin svg { width: 40px; height: 40px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.leaflet-container { font: inherit; }

/* small links under the sign-in form (e.g. "Are you a driver? Driver login") */
.signin-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line, rgba(0,0,0,.08)); display: flex; flex-direction: column; gap: 8px; color: var(--muted, #5b6b63); text-align: center; }
.signin-foot a { color: var(--green, #0b5d3b); font-weight: 700; }
.photo-pick { display: flex; align-items: center; gap: 14px; }
.photo-pick img, .photo-pick .ph { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--soft, #eef2ef); display: grid; place-items: center; flex: none; }
img.avatar { object-fit: cover; padding: 0; }
.label { display: block; font-weight: 650; margin-bottom: 6px; }

/* Sign-in: a card over the live map, so the app feels like a map app from the first screen */
.screen.signin { background: linear-gradient(180deg, rgba(10, 30, 20, 0) 0%, rgba(10, 30, 20, .12) 35%, rgba(10, 30, 20, .55) 100%);
  display: flex; flex-direction: column; justify-content: flex-end; }
.screen.signin > .inner { width: 100%; background: var(--surface); border-radius: 22px; padding: 22px 20px; box-shadow: 0 -6px 40px rgba(10, 30, 20, .28); }
.screen.signin .signin-foot { margin-top: 6px; padding-top: 14px; }
@media (min-width: 720px) { .screen.signin { justify-content: center; } }
/* while signing in, show only the map behind the card (no app buttons or empty panels) */
body:has(.screen.signin:not([hidden])) .topbar,
body:has(.screen.signin:not([hidden])) .sheet,
body:has(.screen.signin:not([hidden])) .fab,
body:has(.screen.signin:not([hidden])) .offer { visibility: hidden; }

/* Log in / Sign up switch on the sign-in card */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: 700 .95rem var(--font); padding: 10px; border-radius: 9px; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(10, 30, 20, .12); }
.needs { margin: 0; padding-left: 20px; color: var(--muted); font-size: .92rem; display: grid; gap: 2px; }

/* "By continuing, you agree to…" under Send code, and the updated-terms prompt */
.terms-note { margin: 2px 0 0; text-align: center; } .terms-note a { color: var(--green); font-weight: 650; }
.terms-modal { position: fixed; inset: 0; z-index: 100; background: rgba(10, 30, 20, .45); display: grid; place-items: end center; padding: 16px; }
.terms-card { background: var(--surface); border-radius: 20px; padding: 22px; max-width: 460px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.3); display: grid; gap: 10px; }
.terms-card a { color: var(--green); font-weight: 700; }
@media (min-width: 720px) { .terms-modal { place-items: center; } }
/* password box with a Show/Hide button, and plain text buttons ("Forgot password?") */
.pw-input { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.pw-input:focus-within, .phone-input:focus-within { border-color: var(--green, #0b5d3b); }
.pw-input input { border: 0; border-radius: 0; flex: 1; min-width: 0; }
.pw-eye { border: 0; background: var(--soft); color: var(--ink, inherit); font: 650 .85rem var(--font); padding: 0 14px; cursor: pointer; }
.linkbtn { border: 0; background: none; color: var(--green, #0b5d3b); font: 700 .95rem var(--font); padding: 6px; cursor: pointer; align-self: center; }
.linkbtn:hover { text-decoration: underline; }
/* "Continue with Google / Apple" and the divider under them */
.btn.social { background: #fff; color: #1f1f1f; border: 1px solid #c8cfca; }
.btn.social.apple { background: #000; color: #fff; border-color: #000; }
#g-btn { display: flex; justify-content: center; min-height: 44px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted, #5b6b63); font-size: .85rem; margin: 6px 0 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line, rgba(0,0,0,.1)); }
