/* ============================================================
 * Senior Rides App — prototype look (Phase 1 approved design)
 * Palette + type + 3D buttons match the Phase 1 Senior App
 * Prototype exactly: Source Serif 4 headings, Atkinson
 * Hyperlegible body, color-coded press-down big buttons.
 * ============================================================ */

:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #eaf0f4;
  --text: #13243a;
  --muted: #506277;
  --blue: #315ba8;
  --blue-deep: #21437f;
  --green: #4f9c63;
  --green-deep: #2e7044;
  --green-shadow: #1e5632;
  --gold: #f3bd3d;
  --red: #bd3737;
  --line: #cbd5de;
  --nav: #11253f;
  --terracotta: #b15335;
  --terracotta-deep: #8a3f27;
  --slate: #4b5563;
  --slate-deep: #333c47;
  /* aliases used by older rules */
  --blue-dark: #21437f;
  --green-dark: #2e7044;
  --ink: #13243a;
  --card: #ffffff;
  --danger: #bd3737;
  --radius: 18px;
  --font-body: "Atkinson Hyperlegible", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Source Serif 4", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 2px;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-bottom: 110px; /* room for the fixed footer nav */
}

/* ---------- header ---------- */
.header {
  background: var(--blue);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.header img.logo { height: 56px; width: auto; }
.header .title { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.header .subtitle { font-size: 0.95rem; opacity: 0.9; }

/* ---------- screens ---------- */
.screen { display: none; padding: 22px 18px 40px; flex: 1; }
.screen.active { display: block; }

h1, h2, h3 { font-family: var(--font-head); color: var(--text); margin: 0.4em 0 0.6em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.4rem; }
p.lead { font-size: 1.1rem; color: var(--muted); }

/* ---------- home card (prototype signature) ---------- */
.home-card {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(19, 36, 58, 0.08);
  padding: 28px 22px;
}
.home-kicker {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 6px;
  text-align: center;
}
.home-card h1 { text-align: center; font-size: 1.8rem; margin: 0 0 20px; }

/* ---------- 3D destination buttons (prototype signature) ---------- */
.dest-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 94px;
  margin: 14px 0;
  padding: 14px 20px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  color: #fff;
  text-align: left;
  font-family: var(--font-body);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.dest-icon { font-size: 42px; line-height: 1; flex: none; }
.dest-text strong { display: block; font-size: 1.35rem; font-weight: 700; }
.dest-text small { display: block; font-size: 0.95rem; font-weight: 400; opacity: 0.88; margin-top: 2px; }

.dest-healthcare { background: var(--blue); box-shadow: 0 6px 0 var(--blue-deep); }
.dest-healthcare:active { transform: translateY(6px); box-shadow: 0 0 0 var(--blue-deep); }
.dest-grocery { background: var(--green-deep); box-shadow: 0 6px 0 var(--green-shadow); }
.dest-grocery:active { transform: translateY(6px); box-shadow: 0 0 0 var(--green-shadow); }
.dest-salon { background: var(--terracotta); box-shadow: 0 6px 0 var(--terracotta-deep); }
.dest-salon:active { transform: translateY(6px); box-shadow: 0 0 0 var(--terracotta-deep); }
.dest-book { background: var(--slate); box-shadow: 0 6px 0 var(--slate-deep); }
.dest-book:active { transform: translateY(6px); box-shadow: 0 0 0 var(--slate-deep); }

/* ---------- big buttons (3D, prototype style) ---------- */
.big-btn {
  display: block;
  width: 100%;
  padding: 24px 18px;
  margin: 14px 0;
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 6px 0 var(--blue-deep);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.big-btn:active { transform: translateY(6px); box-shadow: 0 0 0 var(--blue-deep); }
.big-btn.green { background: var(--green-deep); box-shadow: 0 6px 0 var(--green-shadow); }
.big-btn.green:active { transform: translateY(6px); box-shadow: 0 0 0 var(--green-shadow); }
.big-btn.secondary {
  background: var(--surface);
  color: var(--blue-deep);
  border: 3px solid var(--blue);
  box-shadow: 0 6px 0 var(--line);
}
.big-btn.secondary:active { transform: translateY(6px); box-shadow: 0 0 0 var(--line); }
.big-btn .sub { display: block; font-size: 1rem; font-weight: 400; margin-top: 6px; opacity: 0.85; }
.big-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- inline expand panels ---------- */
.inline-panel {
  display: none;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin: -4px 0 14px;
}
.inline-panel.open { display: block; }
.inline-panel .prompt {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
}
.choice-btn {
  display: block;
  width: 100%;
  padding: 20px 14px;
  margin: 10px 0;
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--surface);
  color: var(--text);
  border: 3px solid var(--green-deep);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 0 var(--green-shadow);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.choice-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--green-shadow); }
.choice-btn .sub { display: block; font-size: 1rem; font-weight: 400; color: var(--muted); margin-top: 4px; }

/* ---------- forms ---------- */
.field { margin: 16px 0; }
.field label {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 18px 14px;
  font-family: var(--font-body);
  font-size: 1.25rem;
  color: var(--text);
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 4px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--blue);
}
.field .hint { font-size: 1rem; color: var(--muted); margin-top: 6px; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* ---------- cards / lists ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 14px 0;
  box-shadow: 0 2px 8px rgba(19, 36, 58, 0.08);
}
.card h3 { margin: 0 0 8px; font-size: 1.3rem; }
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 4px;
  border-bottom: 2px solid var(--surface-2);
  font-size: 1.1rem;
}
.list-item:last-child { border-bottom: none; }

.small-btn {
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
  border: 2px solid var(--blue);
  background: #fff;
  color: var(--blue-deep);
  cursor: pointer;
}
.small-btn.danger { border-color: var(--danger); color: var(--danger); }
.small-btn.solid { background: var(--blue); color: #fff; border-color: var(--blue); }

.link-btn {
  background: none; border: none; color: var(--blue);
  font-family: var(--font-body);
  font-size: 1.1rem; font-weight: 700; cursor: pointer;
  padding: 10px; text-decoration: underline;
}

/* ---------- status / alerts ---------- */
.alert {
  padding: 16px;
  border-radius: 14px;
  font-size: 1.05rem;
  margin: 14px 0;
}
.alert.error { background: #fdecea; color: var(--danger); border: 2px solid var(--danger); }
.alert.info { background: #e8eef7; color: var(--blue-deep); border: 2px solid var(--blue); }
.alert.ok { background: #e9f7ee; color: var(--green-deep); border: 2px solid var(--green-deep); }

.spinner {
  width: 44px; height: 44px; margin: 20px auto;
  border: 6px solid var(--surface-2); border-top-color: var(--blue);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- RidePass plans (prototype-exact) ---------- */
.plan-card {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 24px;
  padding: 24px 20px;
  margin: 18px 0;
  box-shadow: 0 4px 14px rgba(19, 36, 58, 0.06);
}
.plan-card.featured {
  border-color: var(--green-deep);
  box-shadow: 0 6px 0 var(--green-shadow), 0 10px 24px rgba(19, 36, 58, 0.10);
}
.plan-tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.plan-tag.hot {
  background: var(--green-deep);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
}
.plan-card h3 { margin: 4px 0; font-size: 1.6rem; }
.plan-price { font-family: var(--font-head); font-size: 2.4rem; font-weight: 700; color: var(--text); margin: 6px 0 12px; }
.plan-price span { font-family: var(--font-body); font-size: 1.05rem; font-weight: 400; color: var(--muted); }
.plan-features { list-style: none; padding: 0; margin: 0 0 18px; }
.plan-features li {
  font-size: 1.1rem;
  padding: 8px 0 8px 34px;
  position: relative;
  border-bottom: 2px solid var(--surface-2);
}
.plan-features li:last-child { border-bottom: none; }
.plan-features li::before {
  content: "✓";
  position: absolute;
  left: 6px;
  color: var(--green-deep);
  font-weight: 700;
}

/* ---------- footer nav ---------- */
.footer-nav {
  display: flex;
  background: var(--nav);
  border-top: 3px solid var(--nav);
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 560px;
  margin: 0 auto;
  z-index: 50;
}
.footer-nav button {
  flex: 1;
  padding: 16px 6px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  background: none;
  border: none;
  color: var(--line);
  cursor: pointer;
}
.footer-nav button.active { color: #fff; border-top: 5px solid var(--gold); }

/* ---------- policies page ---------- */
.policy { background: #fff; border-radius: var(--radius); padding: 22px 18px; margin: 14px 0; }
.policy h2 { margin-top: 0; }
.policy p, .policy li { font-size: 1.05rem; }

.fare-line { display: flex; justify-content: space-between; font-size: 1.2rem; padding: 8px 0; }
.fare-total { display: flex; justify-content: space-between; font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--text); border-top: 3px solid var(--blue); padding-top: 12px; margin-top: 8px; }

#recaptcha-container { margin: 16px 0; min-height: 78px; }

/* ---------- Add to Home Screen banner ---------- */
.install-banner {
  position: fixed;
  bottom: 88px; left: 12px; right: 12px;
  max-width: 536px; margin: 0 auto;
  z-index: 60;
  background: #fff;
  border: 3px solid var(--blue);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  padding: 14px 12px;
  display: flex; align-items: center; gap: 12px;
}
.install-banner-icon { width: 52px; height: 52px; border-radius: 12px; flex: none; }
.install-banner-text { flex: 1; font-size: 1rem; line-height: 1.35; }
.install-banner-text strong { display: block; font-size: 1.12rem; margin-bottom: 2px; }
.install-banner .big-btn { flex: none; padding: 12px 20px; font-size: 1.05rem; }
.install-banner-close {
  position: absolute; top: 4px; right: 6px;
  background: none; border: none; font-size: 1rem; cursor: pointer; color: var(--line);
  padding: 8px; line-height: 1;
}

.hidden { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 24px; }

/* ---------- app header (driver/admin/dispatch pages) ---------- */
.app-header { background: var(--blue); color: #fff; padding: 12px 18px; }
.app-header .header-inner { display: flex; align-items: center; gap: 12px; max-width: 900px; margin: 0 auto; }
.app-header .header-logo { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.app-header .brand { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }
.app-header .subtitle { font-size: .85rem; opacity: .85; }

/* ---------- next-stage design (2026-10-14) ---------- */

/* greeting + avatar */
.greet-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin: 2px 2px 14px;
}
.greet { font-family: var(--font-head); font-size: 1.55rem; font-weight: 700; color: var(--text); }
.greet-sub { color: var(--muted); font-size: 1rem; margin-top: 2px; }
.avatar {
  flex: none; width: 58px; height: 58px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700;
  box-shadow: 0 4px 0 var(--blue-deep);
}

/* active trip banner on home */
.active-card { border: 3px solid var(--green-deep); }
.active-card h3 { color: var(--green-deep); }

/* footer nav: 5 tabs */
.footer-nav button { font-size: 0.98rem; padding: 10px 2px 12px; }
.footer-nav button .nav-ico { display: block; font-size: 1.35rem; line-height: 1.15; }
.footer-nav button.active { border-top: 5px solid var(--gold); padding-top: 5px; }

/* My trips */
.trips-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.trips-head h1 { margin-bottom: 2px; }
.trips-head .lead { margin: 0 0 8px; }
.trips-head .small-btn { flex: none; margin-top: 8px; }
.tabs { display: flex; gap: 8px; margin: 12px 0 4px; }
.tab {
  flex: 1; padding: 13px 4px; border-radius: 999px; cursor: pointer;
  border: 3px solid var(--line); background: var(--surface);
  font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; color: var(--muted);
}
.tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.trip-card { padding: 16px; }
.trip-top { display: flex; gap: 12px; align-items: flex-start; }
.date-badge {
  flex: none; width: 58px; text-align: center;
  background: var(--surface-2); border-radius: 14px; padding: 8px 2px;
}
.date-badge strong { display: block; font-size: 1.35rem; line-height: 1.1; color: var(--text); }
.date-badge span { font-size: 0.85rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.trip-main { flex: 1; min-width: 0; }
.trip-main h3 { font-size: 1.18rem; margin: 0 0 4px; }
.trip-meta { color: var(--muted); font-size: 1rem; margin: 2px 0; }
.trip-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.pill {
  display: inline-block; flex: none;
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.pill-blue { background: #e8eef7; color: var(--blue-deep); }
.pill-green { background: #e9f7ee; color: var(--green-deep); }
.pill-gold { background: #fdf3d7; color: #7a5b00; }
.pill-red { background: #fdecea; color: var(--danger); }

/* tracking */
.track-headline { font-size: 1.65rem; margin-bottom: 4px; }
.track-sub { color: var(--muted); font-size: 1.1rem; margin: 4px 0 10px; }
.progress-steps { display: flex; align-items: flex-start; margin: 22px 4px 6px; }
.pstep { flex: 1; text-align: center; position: relative; }
.pstep::before {
  content: ""; position: absolute; top: 13px; left: -50%; width: 100%;
  height: 5px; background: var(--line); border-radius: 3px;
}
.pstep:first-child::before { display: none; }
.pstep .dot {
  position: relative; z-index: 1;
  width: 27px; height: 27px; margin: 0 auto; border-radius: 50%;
  background: #fff; border: 4px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
}
.pstep.done::before { background: var(--green-deep); }
.pstep.done .dot { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.pstep.now .dot { border-color: var(--gold); background: #fdf3d7; }
.pstep .plabel { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 6px; font-weight: 700; }
.pstep.done .plabel, .pstep.now .plabel { color: var(--text); }

.timeline { list-style: none; padding: 0; margin: 8px 0 0; }
.timeline li {
  position: relative; padding: 0 0 16px 30px; color: var(--muted); font-size: 1.05rem;
}
.timeline li::before {
  content: ""; position: absolute; left: 7px; top: 7px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 3px solid var(--line);
}
.timeline li::after {
  content: ""; position: absolute; left: 12px; top: 26px; bottom: 0;
  width: 3px; background: var(--line); border-radius: 2px;
}
.timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--text); }
.timeline li.done::before { background: var(--green-deep); border-color: var(--green-deep); }
.timeline .ttime { display: block; font-size: 0.92rem; color: var(--muted); }

/* driver card */
.driver-card { border: 3px solid var(--blue); }
.driver-top { display: flex; gap: 14px; align-items: center; }
.driver-top .avatar { background: var(--green-deep); box-shadow: 0 4px 0 var(--green-shadow); }
.driver-name { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; }
.call-row { display: flex; gap: 10px; margin-top: 12px; }
.call-row .big-btn { margin: 6px 0; padding: 17px 10px; font-size: 1.2rem; text-decoration: none; }
a.big-btn { text-decoration: none; }
.sos-btn {
  display: block; width: 100%; padding: 16px; margin-top: 12px;
  background: #fff; color: var(--danger);
  border: 3px solid var(--danger); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 1.15rem; font-weight: 700; cursor: pointer;
}
.danger-btn { background: var(--red) !important; box-shadow: 0 6px 0 #7e2626 !important; }

/* SOS sheet */
.sos-sheet {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(10, 22, 38, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 14px;
}
.sos-card {
  background: #fff; border-radius: 22px; padding: 22px 18px;
  width: 100%; max-width: 532px; text-align: center;
}
.sos-card .big-btn { text-decoration: none; }
