/* TownGboro styles. Every value comes from DESIGN.md. */
:root {
  --ink: #071A31;
  --paper: #FCFBF8;
  --yellow: #FFC727;
  --muted: #5F6D77;
  --panel: #F5F3EE;
  --card: #FFFFFF;
  --line: #E4E6E9;
  --danger: #B3261E;
  --go: #0F7B4B;
  --green: var(--go); /* older name, still used by admin.html */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/22px var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }

/* ---------- Logo bar ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 560px; margin: 0 auto; padding: 14px 16px; min-height: 64px;
}
.logo { font-weight: 700; font-size: 22px; letter-spacing: -0.4px; text-decoration: none; color: var(--ink); }
.logo b { background: var(--yellow); padding: 0 5px; border-radius: 6px; margin-left: 1px; }
#who { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); }

main { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }

/* ---------- Top panel ---------- */
.panel {
  background: var(--panel); border-radius: 32px; padding: 32px 16px;
  text-align: center; display: grid; gap: 8px; justify-items: center; margin: 0 -8px 24px;
}
.panel h1 { font-weight: 500; font-size: 40px; line-height: 44px; letter-spacing: -0.8px; }
.panel h1.small { font-size: 32px; line-height: 36px; letter-spacing: -0.5px; }
.panel p { color: var(--muted); }
h2 { font-weight: 500; font-size: 24px; line-height: 26px; letter-spacing: -0.3px; }
.muted, .hint { color: var(--muted); font-size: 14px; line-height: 20px; }
.opt { color: var(--muted); font-weight: 400; }

/* ---------- Layout helpers ---------- */
.stack { display: grid; gap: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.center { text-align: center; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 20px; display: grid; gap: 16px;
}

/* ---------- Buttons: one yellow per screen ---------- */
.btn, .go {
  -webkit-appearance: none; appearance: none;
  font: 500 16px/22px var(--font); text-align: center; text-decoration: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 48px; padding: 14px 20px; border-radius: 20px;
  border: 1.5px solid transparent;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, opacity 160ms ease;
}
.btn:active, .go:active { transform: scale(0.97); }
.btn:disabled, .go:disabled { opacity: 0.55; cursor: wait; transform: none; }
.btn-primary, .go { background: var(--yellow); color: var(--ink); }
.btn-ink, .go.share { background: var(--ink); color: var(--paper); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); }
.btn:focus-visible, .go:focus-visible, .link:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover, .go:hover { background: #F5B800; }
  .btn-ink:hover, .go.share:hover { background: #132B48; }
  .btn-outline:hover { background: var(--panel); }
}
.link {
  font: inherit; background: none; border: 0; padding: 10px 8px; min-height: 44px;
  color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
#who .link { color: var(--muted); font-size: 14px; padding: 10px 6px; white-space: nowrap; }
@media (max-width: 420px) { #who > span:first-child { display: none; } }
.g-mark {
  width: 22px; height: 22px; border-radius: 6px; background: #fff; color: #4285F4;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}

/* ---------- Forms ---------- */
form { display: grid; gap: 16px; }
label, legend { font-weight: 500; display: grid; gap: 6px; }
input, select {
  font: 400 16px/22px var(--font); width: 100%; min-height: 48px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
select {
  -webkit-appearance: none; appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input:focus, select:focus { outline: none; border: 2px solid var(--ink); padding: 11px 13px; }
select:focus { padding-right: 39px; }
::placeholder { color: #8A949C; }
[aria-invalid="true"] { border: 2px solid var(--danger); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }
.error { color: var(--danger); font-weight: 500; font-size: 14px; line-height: 20px; }
.other-place { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: var(--panel); }

/* Segmented choice (number of people) */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg label { display: block; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg span {
  display: grid; place-items: center; min-height: 48px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; font-weight: 500; cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.seg span:active { transform: scale(0.97); }
.seg input:checked + span { border: 2px solid var(--ink); }
.seg input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 1px; }

/* Tick boxes (sign-up forms) */
.ticks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ticks label, .consent {
  display: flex; align-items: center; gap: 10px; font-weight: 400; min-height: 48px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: #fff;
}
.ticks input, .consent input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; accent-color: var(--ink); }
.ticks label:has(input:checked) { border: 2px solid var(--ink); padding: 9px 11px; }
.consent { align-items: flex-start; }
.naira { display: flex; align-items: center; gap: 8px; }
.naira > span { font-weight: 700; }

/* On/off switch (driver online) */
.switch {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 12px 20px; border-radius: 24px; background: var(--card);
  border: 1px solid var(--line); cursor: pointer; font-weight: 500; font-size: 18px;
}
.switch input {
  -webkit-appearance: none; appearance: none; flex: none; width: 56px; height: 32px; min-height: 0;
  padding: 0; border: 0; border-radius: 999px; background: #C9CED3; position: relative; cursor: pointer;
  transition: background-color 200ms ease;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(7, 26, 49, .2); transition: transform 200ms var(--ease-out);
}
.switch input:checked { background: var(--go); }
.switch input:checked::after { transform: translateX(24px); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.switch input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---------- Ride bits ---------- */
.ride-summary { display: grid; gap: 8px; }
.route { display: grid; gap: 6px; font-weight: 500; }
.route span { display: flex; align-items: center; gap: 10px; }
.route span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--go); flex: none; }
.route span + span::before { background: var(--danger); }
.price-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 20px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.price-box strong { font-size: 32px; line-height: 36px; font-weight: 700; letter-spacing: -0.5px; }
.price-box small { display: block; color: var(--muted); font-size: 14px; }
.tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--go); font-weight: 500; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--go); }
.plate {
  font-weight: 700; letter-spacing: 1px; background: #fff; border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}
.pulse { width: 72px; height: 72px; border-radius: 50%; background: var(--yellow); margin-bottom: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: pulse 1.6s ease-in-out infinite; }
}
@keyframes pulse { 0%, 100% { transform: scale(.85); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.list > li { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 16px 20px; display: grid; gap: 8px; }
.list > li.empty { background: none; border: 0; text-align: center; color: var(--muted); padding: 24px 8px; }
.list button { -webkit-appearance: none; appearance: none; font: 500 16px/22px var(--font); min-height: 48px; border: 0; border-radius: 20px; background: var(--yellow); color: var(--ink); cursor: pointer; transition: transform 160ms var(--ease-out); }
.list button:active { transform: scale(0.97); }
.list button:disabled { opacity: .55; }
.list button.ask { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.list .row2 { margin-top: 10px; }
.total { font-weight: 700; font-size: 24px; line-height: 28px; }

/* On-page message (replaces alert pop-ups) */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 10;
  max-width: 528px; margin: 0 auto; padding: 14px 18px; border-radius: 16px;
  background: var(--ink); color: var(--paper); font-weight: 500; box-shadow: 0 12px 30px rgba(7, 26, 49, .25);
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 200ms var(--ease-out); }
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.btn[data-armed] { background: var(--danger); color: #fff; }

/* ---------- Waitlist page ---------- */
.hero { padding: 16px 0 8px; }
.hero h1 { font-weight: 500; font-size: 40px; line-height: 44px; letter-spacing: -0.8px; margin-bottom: 12px; }
.lead { color: var(--muted); margin-bottom: 24px; font-size: 18px; line-height: 26px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; background: var(--panel); padding: 4px; border-radius: 16px; }
.choice button {
  font: 500 16px/22px var(--font); min-height: 48px; border-radius: 12px; cursor: pointer;
  border: 0; background: transparent; color: var(--ink); transition: transform 160ms var(--ease-out);
}
.choice button:active { transform: scale(0.97); }
.choice button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.card h2 { margin: 0; }
.card > .hint { margin-top: -8px; }
.done { text-align: center; }

footer { text-align: center; color: var(--muted); font-size: 14px; line-height: 20px; padding: 8px 16px 32px; }
footer p + p { margin-top: 4px; }

@media (min-width: 640px) {
  .panel h1, .hero h1 { font-size: 56px; line-height: 60px; letter-spacing: -1.2px; }
}
@media (max-width: 360px) {
  .ticks { grid-template-columns: 1fr; }
  .panel h1, .hero h1 { font-size: 34px; line-height: 38px; }
}
