/* ETIKE landing page. Mobile-first.
   Black and white with greys, one typeface, the map carries the colour. */

:root {
  --black: #000000;
  --white: #ffffff;
  --gray-50: #f6f6f6;
  --gray-100: #eeeeee;
  --gray-200: #e2e2e2;
  --gray-500: #757575;
  --gray-700: #4b4b4b;
  --lake: #cfe1ea;
  --route: #000000;
  --bad: #e11900;
  --info: #1d4ed8; /* confirmation banners */
  --good: #0e8345;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
  --max: 80rem;
  --gutter: 1rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--black);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}
.skip:focus {
  top: 0.75rem;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Top bar ---------- */

.topbar {
  background: var(--black);
  color: var(--white);
}
.topbar-inner {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.topbar nav {
  margin-right: auto;
}
.topbar-links {
  display: none;
  gap: 0.25rem;
}
.topbar-links a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease-out;
}
.topbar-links a:hover {
  background: rgb(255 255 255 / 0.14);
}
.topbar :focus-visible {
  outline-color: var(--white);
}

/* ---------- Hero: search on the left, map on the right ---------- */

.hero {
  display: grid;
  gap: 2rem;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.hero-sub {
  margin-top: 1rem;
  max-width: 30rem;
  font-size: 1.0625rem;
  color: var(--gray-700);
}

.trip {
  margin-top: 1.75rem;
  max-width: 30rem;
  display: grid;
  gap: 0.75rem;
}

/* Mode chips */
.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem 0.55rem 0.8rem;
  border-radius: 999px;
  background: var(--gray-100);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.mode span:hover {
  background: var(--gray-200);
}
.mode svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mode input:checked + span {
  background: var(--black);
  color: var(--white);
}
.mode input:focus-visible + span {
  outline: 3px solid var(--black);
  outline-offset: 2px;
}

/* From / to: one grey box, dot and square joined by a line */
.stops {
  position: relative;
  background: var(--gray-100);
  border-radius: var(--radius);
}
.stops::before {
  /* The line between the two markers */
  content: "";
  position: absolute;
  left: calc(1.3rem - 1px);
  top: 1.85rem;
  bottom: 1.85rem;
  width: 2px;
  background: var(--black);
}
.stop {
  position: relative;
  display: block;
}
.stop::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 50%;
  width: 0.6rem;
  height: 0.6rem;
  transform: translateY(-50%);
  background: var(--black);
  pointer-events: none;
}
.stop-from::before {
  border-radius: 50%;
}
.stop + .stop {
  border-top: 1px solid var(--gray-200);
  margin-left: 2.6rem;
}
.stop + .stop::before {
  left: -1.6rem;
}
.stop select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  padding: 0.9rem 1rem 0.9rem 2.6rem;
  font: inherit;
  font-weight: 500;
  font-size: 1rem;
  color: var(--black);
  cursor: pointer;
}
.stop + .stop select {
  padding-left: 0;
}
.stop select:focus-visible {
  outline: none;
  border-color: var(--black);
  background: var(--white);
}

.extras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.field {
  display: grid;
  gap: 0.1rem;
  background: var(--gray-100);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 0.45rem 0.85rem;
}
.field:focus-within {
  border-color: var(--black);
  background: var(--white);
}
.field span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
}
.field input,
.field select {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-weight: 500;
  outline: none;
  width: 100%;
  color: var(--black);
}

.btn-black {
  border: 0;
  border-radius: var(--radius);
  background: var(--black);
  color: var(--white);
  font: inherit;
  font-weight: 600;
  font-size: 1.0625rem;
  padding: 0.95rem 1.5rem;
  cursor: pointer;
  transition: transform 120ms ease-out, background-color 150ms ease-out;
}
.btn-black:hover {
  background: #333;
}
.btn-black:active {
  transform: scale(0.98);
}
.trip-msg:empty {
  display: none;
}
.trip-msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--gray-50);
  border-left: 4px solid var(--black);
  font-size: 0.9375rem;
}
.trip-msg[data-tone="error"] {
  border-left-color: var(--bad);
}

/* ---------- Map ---------- */

.map {
  display: grid;
  gap: 0.75rem;
}
.map-canvas {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 1rem;
}
.rmap {
  position: relative;
}
.rmap svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.rmap-unavailable {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--gray-700);
}
.trip-summary {
  font-size: 0.9375rem;
  color: var(--gray-700);
}
.map-credit {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

/* Country border: a thick black stroke under the districts, so only its
   outer half shows. */
.rmap-outline path {
  fill: none;
  stroke: var(--black);
  stroke-width: 3;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* Districts: flat white shapes with fine grey borders */
.rmap-districts path {
  fill: var(--white);
  stroke: #d4d4d4;
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  outline: none;
  transition: fill 150ms ease-out;
}
.rmap-districts path:hover {
  fill: var(--gray-50);
}
.rmap-districts path:focus-visible {
  fill: var(--gray-200);
}
.rmap-districts path.is-from,
.rmap-districts path.is-to {
  fill: var(--gray-200);
}

.rmap-labels text {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  fill: var(--gray-500);
  text-anchor: middle;
  pointer-events: none;
}
.rmap-labels .rmap-city {
  font-size: 13px;
  font-weight: 700;
  fill: var(--black);
}
/* Route: black line on a white casing, drawn from start to end */
.rmap-route path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.rmap-casing {
  stroke: var(--white);
  stroke-width: 8;
}
.rmap-line {
  stroke: var(--black);
  stroke-width: 4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: rmap-draw 700ms var(--ease-out) forwards;
}
.rmap-line.is-drawn {
  stroke-dasharray: none;
}
.rmap-dashed {
  stroke-width: 2.5;
  stroke-dasharray: 6 8;
  stroke-dashoffset: 0;
  animation: none;
}
@keyframes rmap-draw {
  to {
    stroke-dashoffset: 0;
  }
}
.rmap-ends circle,
.rmap-ends rect {
  fill: var(--black);
  stroke: var(--white);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

/* Name tags on the trip ends, positioned over the SVG */
.rmap-tags {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.rmap-tag {
  position: absolute;
  transform: translate(12px, -50%);
  background: var(--black);
  color: var(--white);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

/* "Leave from here / Go here" */
.rmap-pop {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, calc(-100% - 12px));
  display: grid;
  gap: 0.4rem;
  min-width: 10rem;
  padding: 0.75rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.16);
  animation: rmap-pop 150ms var(--ease-out);
  transform-origin: bottom center;
}
.rmap-pop-below {
  transform: translate(-50%, 12px);
  transform-origin: top center;
}
@keyframes rmap-pop {
  from {
    opacity: 0;
    scale: 0.96;
  }
}
.rmap-pop-title {
  font-weight: 700;
  font-size: 0.9375rem;
}
.rmap-pop button {
  border: 0;
  border-radius: 6px;
  background: var(--gray-100);
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease-out;
}
.rmap-pop button:hover {
  background: var(--gray-200);
}
.rmap-pop button[data-role="to"] {
  background: var(--black);
  color: var(--white);
}

/* The map scales down on phones, so its labels start larger there. */
@media (max-width: 40rem) {
  .rmap-labels text,
  .rmap-water {
    font-size: 15px;
  }
  .rmap-labels .rmap-city {
    font-size: 18px;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}
.section h2,
.drive h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.ways {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}
.way {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.way h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.way p {
  margin-top: 0.4rem;
  color: var(--gray-700);
  font-size: 0.9375rem;
}
.way-art {
  flex: none;
  width: 5.5rem;
  height: auto;
  fill: none;
  stroke: var(--black);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 2rem;
  margin-top: 1.75rem;
}
.steps li {
  counter-increment: step;
  border-top: 2px solid var(--black);
  padding-top: 1rem;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9375rem;
}
.steps h3 {
  font-size: 1.15rem;
  font-weight: 700;
}
.steps p {
  margin-top: 0.3rem;
  color: var(--gray-700);
}

.drive {
  background: var(--black);
  color: var(--white);
}
.drive-inner {
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.drive-cols {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}
.drive h3 {
  font-size: 1.25rem;
  font-weight: 700;
}
.drive p {
  margin-top: 0.4rem;
  color: rgb(255 255 255 / 0.72);
  max-width: 34ch;
}

.footer {
  background: var(--black);
  color: rgb(255 255 255 / 0.6);
  font-size: 0.875rem;
  border-top: 1px solid rgb(255 255 255 / 0.14);
}
.footer-top {
  display: grid;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 2.5rem;
}
.footer .brand {
  color: var(--white);
  font-size: 1.5rem;
}
.footer-brand p {
  margin-top: 0.5rem;
  max-width: 18rem;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 1.5rem;
}
.footer h2 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}
.footer ul {
  display: grid;
}
.footer a {
  display: inline-block;
  padding-block: 0.7rem;
  text-decoration: none;
  transition: color 150ms ease-out;
}
.footer a:hover {
  color: var(--white);
}
.footer :focus-visible {
  outline-color: var(--white);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.75rem;
  border-top: 1px solid rgb(255 255 255 / 0.14);
}

/* ---------- Phones and tablets: the map above the form ---------- */
/* One column: title, map, the route summary, then the form, so the route
   shows on the map right above the fields while you choose. The intro
   text and map credits move below the form. Wider screens keep the form on
   the left and the map on the right. */
@media (max-width: 59.99rem) {
  .hero {
    gap: 0;
    padding-top: 1.5rem;
  }
  .hero-left,
  .hero .map,
  .hero .map figcaption {
    display: contents;
  }
  .hero .map-canvas {
    order: 1;
    margin-top: 1rem;
    padding: 0.5rem;
  }
  .hero .trip-summary {
    order: 2;
    margin-top: 0.5rem;
  }
  .hero .trip {
    order: 3;
    margin-top: 1rem;
    max-width: none;
  }
  .hero .hero-sub {
    order: 4;
    margin-top: 1.5rem;
  }
  .hero .coming-soon {
    order: 5;
  }
  .hero .map-credit {
    order: 6;
    margin-top: 1rem;
  }
}

/* ---------- Phones: behave like a mobile app ---------- */
.tabbar {
  display: none;
}
@media (max-width: 59.99rem) {
  html {
    /* No scrollbar on phones; scrolling works as usual. */
    scrollbar-width: none;
    -webkit-tap-highlight-color: transparent;
  }
  html::-webkit-scrollbar {
    display: none;
  }
  /* Bottom tab bar instead of the top-bar links and the website footer. */
  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    display: flex;
    justify-content: space-around;
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 0.96);
    border-top: 1px solid var(--gray-200);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .tabbar a,
  .tabbar button {
    flex: 1;
    min-height: 3.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    border: 0;
    background: none;
    color: var(--gray-500);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
  }
  .tabbar svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .tabbar a {
    position: relative;
  }
  .tabbar .badge {
    position: absolute;
    top: 0.2rem;
    left: calc(50% + 0.4rem);
    margin: 0;
  }
  .tabbar [aria-current="page"] {
    color: var(--black);
  }
  .tabbar :active {
    transform: scale(0.96);
  }
  body.has-tabbar {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }
  body.has-tabbar .account,
  body.has-tabbar .topbar-links,
  body.has-tabbar .footer {
    display: none;
  }
  /* Account panel, above the tab bar. */
  .sheet {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(4.75rem + env(safe-area-inset-bottom));
    z-index: 45;
    display: grid;
    gap: 0.35rem;
    padding: 1.1rem;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.2);
  }
  .sheet span {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
  }
  /* The top bar stays put while scrolling, like an app header. */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
  }
}
@media (max-width: 59.99rem) and (prefers-reduced-motion: reduce) {
  .tabbar :active {
    transform: none;
  }
}

/* ---------- Larger screens ---------- */

@media (min-width: 60rem) {
  :root {
    --gutter: 2.5rem;
  }
  .topbar-links {
    display: flex;
  }
  .hero {
    grid-template-columns: minmax(22rem, 30rem) 1fr;
    gap: 4rem;
    align-items: center;
    padding-top: 4rem;
    padding-bottom: 5rem;
  }
  .hero h1 {
    font-size: 3.5rem;
  }
  .map-canvas {
    padding: 1.5rem;
  }
  .ways {
    grid-template-columns: repeat(3, 1fr);
  }
  .way {
    flex-direction: column-reverse;
    justify-content: flex-end;
    padding: 1.75rem;
  }
  .way-art {
    width: 6rem;
    margin-bottom: 1.25rem;
  }
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .drive-cols {
    grid-template-columns: 1fr 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr auto;
    gap: 4rem;
    padding-top: 4rem;
  }
  .footer-cols {
    grid-template-columns: repeat(3, minmax(9rem, auto));
    gap: 3rem;
  }
}

/* ---------- Account area in the top bar ---------- */

.account {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
}
.account a,
.account button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0.5rem 0.85rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease-out;
}
.account a:hover,
.account button:hover {
  background: rgb(255 255 255 / 0.14);
}
.account .account-cta {
  background: var(--white);
  color: var(--black);
}
.account .account-cta:hover {
  background: var(--gray-200);
}
.account-name {
  display: none;
  color: var(--gray-200);
  padding-inline: 0.5rem;
}

/* ---------- App pages: sign-in, search, results, booking, driver ---------- */

.page {
  /* Keeps the footer near the bottom on short pages */
  min-height: calc(100vh - 12rem);
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}
.page-narrow {
  max-width: calc(30rem + 2 * var(--gutter));
}
.page h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.page h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.page-sub {
  margin-top: 0.5rem;
  color: var(--gray-700);
}
.page-sub a,
.form-foot a {
  font-weight: 600;
}

.form {
  margin-top: 1.75rem;
  display: grid;
  gap: 0.75rem;
}
.form .btn-black {
  margin-top: 0.25rem;
}
.form-foot {
  font-size: 0.9375rem;
  color: var(--gray-700);
}
.field-hint {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: -0.4rem;
  padding-inline: 0.25rem;
}
.field.is-invalid {
  border-color: var(--bad);
}
.field-error {
  font-size: 0.8125rem;
  color: var(--bad);
}

.block {
  margin-top: 2.5rem;
  display: grid;
  gap: 1rem;
}

/* Results and bookings */
.result-tabs {
  margin-top: 1.5rem;
}
.result-tabs a {
  text-decoration: none;
}
.result-tabs a[aria-current] span {
  background: var(--black);
  color: var(--white);
}
.results {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.75rem;
}
.result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--gray-50);
}
.result-time {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.result-price {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.result-meta {
  color: var(--gray-700);
  font-size: 0.9375rem;
}
.result-note {
  text-align: right;
  font-size: 0.875rem;
  color: var(--gray-500);
}
.result-actions {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-sm {
  font-size: 0.9375rem;
  padding: 0.6rem 1.1rem;
  min-height: 2.75rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-gray {
  border: 0;
  border-radius: var(--radius);
  background: var(--gray-200);
  color: var(--black);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease-out;
}
.btn-gray:hover {
  background: #d4d4d4;
}
.btn-black:disabled,
.btn-gray:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.status {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--black);
  color: var(--white);
}
.status-cancelled {
  background: var(--gray-200);
  color: var(--gray-700);
}

.empty {
  margin-top: 1.5rem;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  text-align: center;
  color: var(--gray-700);
}
.empty strong {
  display: block;
  color: var(--black);
  font-size: 1.0625rem;
  margin-bottom: 0.25rem;
}
.empty a {
  font-weight: 600;
}

/* Booking summary */
.summary {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  display: grid;
  gap: 0.6rem;
}
.summary div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.summary dt {
  color: var(--gray-700);
}
.summary dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.summary .summary-total {
  border-top: 1px solid var(--gray-200);
  padding-top: 0.75rem;
  font-size: 1.125rem;
}

.loading {
  margin-top: 1.5rem;
  color: var(--gray-500);
}

/* Booking statuses */
.status-pending {
  background: var(--gray-200);
  color: var(--black);
}
.status-approved,
.status-confirmed {
  background: var(--black);
  color: var(--white);
}
.status-rejected {
  background: var(--white);
  color: var(--bad);
  box-shadow: inset 0 0 0 1px var(--bad);
}
.result-wide {
  grid-column: 1 / -1;
}

/* Payment */
.countdown {
  margin-top: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.countdown.is-urgent {
  color: var(--bad);
}
.cancel-note {
  flex-basis: 100%;
  font-size: 0.8125rem;
  color: var(--gray-500);
}
.link-button {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  color: inherit;
  cursor: pointer;
}
.password-login {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}
.password-login summary {
  cursor: pointer;
  font-weight: 600;
}
/* Seat map */
.seatmap-box {
  display: grid;
  gap: 0.75rem;
}
.seatmap-title {
  font-size: 1.125rem;
  font-weight: 700;
}
.seatmap-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--gray-700);
}
.seatmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.seat-key {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 4px;
  border: 2px solid var(--black);
  background: var(--white);
}
.seat-key.is-chosen {
  background: var(--black);
}
.seat-key.is-taken {
  border-color: var(--gray-200);
  background: var(--gray-200);
}
.seatmap {
  justify-self: center;
  display: grid;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  border: 2px solid var(--gray-200);
  border-radius: 2rem 2rem 1rem 1rem;
  background: var(--gray-50);
}
.seatmap.is-bus {
  border-radius: 1.25rem 1.25rem 0.75rem 0.75rem;
}
.seat-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.seat,
.seat-gap {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
}
.seat {
  border: 2px solid var(--black);
  border-radius: 0.6rem 0.6rem 0.4rem 0.4rem;
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 120ms ease-out, transform 120ms ease-out;
}
.seat:hover:not(:disabled) {
  background: var(--gray-100);
}
.seat:active:not(:disabled) {
  transform: scale(0.94);
}
.seat.is-chosen {
  background: var(--black);
  color: var(--white);
}
.seat.is-taken {
  border-color: var(--gray-200);
  background: var(--gray-200);
  color: var(--gray-500);
  cursor: not-allowed;
}
.seat.is-driver {
  display: grid;
  place-items: center;
  border-color: var(--gray-200);
  background: transparent;
  color: var(--gray-500);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: default;
}
.seat:disabled.is-chosen {
  cursor: default;
}

/* Car photos */
.car-photos {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.car-photos img {
  flex: none;
  width: 100%;
  max-width: 28rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  scroll-snap-align: start;
  background: var(--gray-100);
}
.car-photos img:only-child {
  max-width: 100%;
}
.result-photo {
  grid-column: 1 / -1;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: var(--gray-100);
}
@media (min-width: 40rem) {
  /* Wider screens: the photo as a thumbnail on the left of the details. */
  .result.has-photo {
    grid-template-columns: 9rem 1fr auto;
    column-gap: 1.25rem;
  }
  .result.has-photo .result-photo {
    grid-column: 1;
    grid-row: 1 / span 3;
    margin-bottom: 0;
    align-self: stretch;
    height: 100%;
    aspect-ratio: auto;
  }
  .result.has-photo .result-actions {
    grid-column: 2 / -1;
  }
}
.vehicle-photos {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.vehicle-photos figure {
  position: relative;
}
.vehicle-photos img {
  width: 6.5rem;
  height: 4.9rem;
  object-fit: cover;
  border-radius: var(--radius);
}
.vehicle-photos button {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  padding: 0.25rem 0.6rem;
  min-height: 2rem;
  font-size: 0.8125rem;
  background: rgb(255 255 255 / 0.9);
}
.file-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.file-label:focus-within {
  outline: 3px solid var(--black);
  outline-offset: 2px;
}

/* Ride review before booking (booking.html) */
.review {
  display: grid;
  gap: 0.75rem;
}
.gallery {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gray-100);
}
.gallery-strip {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery-strip::-webkit-scrollbar {
  display: none;
}
.gallery-strip img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  scroll-snap-align: center;
}
.gallery-count {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.6);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 600;
}
.review-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--gray-50);
}
.review-card strong {
  display: block;
}
.review-card span {
  display: block;
  color: var(--gray-700);
  font-size: 0.9375rem;
}
.review-driver {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.85rem;
  align-items: center;
}
.avatar {
  grid-row: span 2;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: grid !important;
  place-items: center;
  background: var(--black);
  color: var(--white) !important;
  font-weight: 700;
  font-size: 1rem !important;
}
.review-car {
  grid-column: 2;
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-200);
}
.review-stops {
  display: grid;
  gap: 0.4rem;
  font-size: 1.125rem;
  font-weight: 600;
}
.review-stops li {
  position: relative;
  padding-left: 1.5rem;
}
.review-stops li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  background: var(--black);
  border-radius: 50%;
}
.review-stops li.is-to::before {
  border-radius: 2px;
}
.review-when {
  margin-top: 0.6rem;
  font-weight: 600;
}
.review-kind {
  color: var(--gray-700);
  font-size: 0.9375rem;
}
.review-pay {
  display: grid;
  gap: 0.3rem;
  border-left: 4px solid #ffcc00; /* MTN MoMo yellow */
}
.review .summary {
  margin-top: 0;
}
.btn-confirm {
  width: 100%;
}

/* A labelled group of choices in a form (e.g. air conditioning yes/no). */
.field-group {
  display: grid;
  gap: 0.4rem;
}
.field-group-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
  padding-inline: 0.25rem;
}

/* Reviews of a driver (review screen and driver page). */
.reviews {
  margin-top: 0.25rem;
  display: grid;
  gap: 0.6rem;
}
#my-reviews .reviews {
  margin-top: 2rem;
}
.reviews-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.reviews-head span {
  color: var(--gray-700);
  font-weight: 600;
}
.reviews-list {
  display: grid;
  gap: 0.5rem;
}
.review {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--gray-50);
  display: grid;
  gap: 0.25rem;
}
.review-stars {
  color: #b7791f;
  letter-spacing: 0.08em;
}
.review p {
  overflow-wrap: anywhere;
}
.review-by,
.reviews-empty {
  font-size: 0.875rem;
  color: var(--gray-700);
}
.rate-form textarea {
  border: 0;
  background: none;
  font: inherit;
  font-size: 1rem;
  resize: vertical;
  outline: none;
}

/* Reaching the other person: Call, WhatsApp, Message (with new count). */
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--bad);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
}
.review-meet {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--gray-200);
}
.trip-person {
  display: grid;
  gap: 0.25rem;
}
.trip-people li {
  align-items: flex-start;
}

/* Chat (chat.html) */
.chat-back {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  font-weight: 600;
}
.chat-info {
  margin-top: 1rem;
  display: grid;
  gap: 0.25rem;
}
.chat-meet {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--gray-50);
}
.chat-list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 5.5rem; /* room for the message box */
}
.chat-bubble {
  max-width: 80%;
  align-self: flex-start;
  padding: 0.6rem 0.85rem;
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: var(--gray-100);
}
.chat-bubble.is-mine {
  align-self: flex-end;
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: var(--black);
  color: var(--white);
}
.chat-bubble p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-time {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  opacity: 0.7;
}
.chat-empty {
  color: var(--gray-700);
  text-align: center;
  padding: 2rem 0;
}
.chat-form {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0.6rem max(var(--gutter), calc((100% - 40rem) / 2)) calc(0.6rem + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--gray-200);
}
.chat-form textarea {
  flex: 1;
  min-height: 2.75rem;
  max-height: 140px;
  resize: none;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--gray-200);
  border-radius: 1.4rem;
  font: inherit;
  font-size: 1rem; /* 16 px: phones don't zoom in */
  background: var(--gray-50);
}
.chat-form .btn-black {
  min-height: 2.75rem;
  border-radius: 1.4rem;
  padding: 0 1.25rem;
}
body.has-tabbar .chat-form {
  bottom: calc(4.4rem + env(safe-area-inset-bottom));
  padding-bottom: 0.6rem;
}
.chat-page .footer {
  display: none;
}

/* Trip on the map (trip.html) */
.trip-map {
  margin-top: 1.25rem;
}
#facts dd {
  white-space: normal;
}
.rmap-ends .rmap-car {
  fill: var(--info);
  stroke: var(--white);
  stroke-width: 3;
}
.trip-live {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--info);
  font-weight: 600;
}
.trip-live::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--info);
}
.trip-live.is-off {
  color: var(--gray-700);
}
.trip-live.is-off::before {
  background: var(--gray-500);
}

/* Driver's trips: Start ride / End ride and payments (driver page). */
.trips {
  display: grid;
  gap: 0.75rem;
}
.trip {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  display: grid;
  gap: 0.5rem;
}
.trip-in_progress {
  background: #eef4ff;
  box-shadow: inset 4px 0 0 var(--info);
}
.trip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.trip-head strong {
  font-size: 1.0625rem;
}
.trip-when {
  color: var(--gray-700);
  font-size: 0.9375rem;
}
.trip-people {
  display: grid;
  gap: 0.35rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}
.trip-people li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9375rem;
}
.trip-pay {
  color: var(--gray-700);
  white-space: nowrap;
}
.trip-pay.is-paid {
  color: var(--good);
  font-weight: 600;
}
.trip-total {
  font-weight: 600;
}
.trip-action {
  width: 100%;
  min-height: 3.25rem;
  font-size: 1.0625rem;
}
.trip-empty {
  color: var(--gray-700);
}
.result.is-new {
  box-shadow: inset 0 0 0 2px var(--info);
}

/* Top banner that confirms what just happened ("Your ride is booked"). */
.toast {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  left: 50%;
  z-index: 50;
  width: min(30rem, calc(100% - 1.5rem));
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--info);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  transform: translate(-50%, 0);
  transition: transform 300ms var(--ease-out), opacity 300ms var(--ease-out);
}
.toast span {
  display: block;
  font-weight: 400;
  font-size: 0.9375rem;
  opacity: 0.9;
}
.toast.is-good {
  background: var(--good);
}
.toast.is-hidden {
  transform: translate(-50%, calc(-100% - 2rem));
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 150ms linear;
  }
  .toast.is-hidden {
    transform: translate(-50%, 0);
  }
}

/* Results: other days to try when the chosen day has nothing. */
.other-days {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}
.other-days span {
  flex-basis: 100%;
  font-weight: 600;
}

/* Driver documents (driver page and admin Drivers page) */
.block-note {
  color: var(--gray-700);
  max-width: 60ch;
}
.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.doc {
  display: grid;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  background: var(--gray-50);
}
.doc-name {
  font-weight: 600;
}
.doc-state {
  font-size: 0.875rem;
  color: var(--gray-700);
}
.result-meta.is-bad,
.doc-state.is-bad {
  color: var(--bad);
}
.doc-actions {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.doc-date {
  font-size: 0.875rem;
  color: var(--gray-700);
}
.doc-actions input[type="date"] {
  font: inherit;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
}
.reject-reason {
  font: inherit;
  font-size: 1rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  min-width: 0;
  width: 14rem;
  max-width: 100%;
}
/* Admin view: two columns of short rows, View on the right. */
.doc-list-compact {
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}
.doc-list-compact .doc {
  grid-template-columns: 1fr auto;
  column-gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--white);
}
.doc-list-compact .doc-name,
.doc-list-compact .doc-state {
  grid-column: 1;
}
.doc-list-compact .doc-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-top: 0;
}

/* Ticket */
.ticket-card {
  margin-top: 1.5rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--black);
  overflow: hidden;
}
.ticket-head {
  background: var(--black);
  color: var(--white);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.ticket-head strong {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.ticket-body {
  padding: 1.25rem;
  display: grid;
  gap: 1.25rem;
}
.ticket-qr {
  justify-self: center;
  width: 13rem;
  max-width: 100%;
}
.ticket-qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.ticket-card .ticket {
  margin: 0;
  border-style: solid;
}

/* Ticket check (what a scanner sees) */
.verdict {
  margin-top: 1.5rem;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  display: grid;
  gap: 0.5rem;
}
.verdict strong {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.verdict.is-valid {
  background: #0a7d32;
  color: var(--white);
}
.verdict.is-invalid {
  background: var(--bad);
  color: var(--white);
}

/* Bus booking is a future phase: bus-only things show only when the API's
   /api/config says it is on (api.js then adds .has-bus to <html>). */
html:not(.has-bus) [data-feature="bus"],
html:not(.has-demo) [data-feature="demo"] {
  display: none !important;
}
/* Hide links meant for other roles. */
html[data-role="visitor"] [data-for]:not([data-for~="visitor"]),
html[data-role="passenger"] [data-for]:not([data-for~="passenger"]),
html[data-role="driver"] [data-for]:not([data-for~="driver"]),
html[data-role="admin"] [data-for]:not([data-for~="admin"]) {
  display: none !important;
}

.demo-login {
  margin-top: 2.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--gray-200);
  display: grid;
  gap: 0.6rem;
}
.demo-login h2 {
  font-size: 1rem;
  font-weight: 700;
}
.demo-login p {
  color: var(--gray-700);
  font-size: 0.9375rem;
}
.demo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.coming-soon {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}
.sandbox-note {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--gray-700);
}
.waiting {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
  justify-items: start;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  border-left: 4px solid var(--black);
}
#result .form-foot a {
  margin-right: 1rem;
}

/* Ticket and rating on My bookings */
.ticket {
  grid-column: 1 / -1;
  margin: 0.75rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px dashed var(--gray-200);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
}
.ticket dt {
  font-size: 0.8125rem;
  color: var(--gray-500);
}
.ticket dd {
  margin: 0;
  font-weight: 600;
}
.rate-form {
  grid-column: 1 / -1;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200);
}
.rate-title {
  font-weight: 600;
}
.rate-form .mode span {
  min-width: 2.75rem;
  justify-content: center;
}
.rate-form .btn-black {
  justify-self: start;
}
.rated {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

@media (min-width: 60rem) {
  .account-name {
    display: inline;
  }
  .page {
    padding-top: 3.5rem;
  }
  .page h1 {
    font-size: 2.5rem;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn-black:active {
    transform: none;
  }
  .rmap-line:not(.rmap-dashed) {
    animation: none;
    stroke-dasharray: none;
  }
  .rmap-pop {
    animation: none;
  }
}
