/* ==========================================================================
   NIMBUS BOOKING TERMINAL — Design System
   "Move better, every time." A route-mark identity: indigo → sky → green,
   the exact gradient a Nimbus pin draws as it travels from pickup to
   drop-off. Calm cloud-white surfaces let that gradient do the talking —
   it only shows up on things that move the trip forward.
   Customer-facing production build: no technical/debug surfaces exposed.
   ========================================================================== */

:root {
  /* --- Color --------------------------------------------------------------
     Brand palette, locked to the Nimbus identity sheet.
  ------------------------------------------------------------------------- */
  --ink-950: #0F172A;
  --ink-800: #1B2136;
  --ink-600: #4A5169;
  --ink-400: #7D8399;
  --ink-200: #DEE2EC;
  --cloud-50: #F1F4F8;
  --cloud-0:  #FFFFFF;

  --route-500: #3B5BDB;
  --route-600: #2C46B8;
  --route-100: #E9EDFC;

  --sky-500: #00C2FF;
  --sky-100: #DFF6FF;

  --pickup-500: #18C37E;
  --pickup-100: #E4F9EF;

  --dest-500: #F04438;
  --dest-100: #FDE9E7;

  --amber-500: #F79009;
  --amber-100: #FEF0D9;

  --gradient-route: linear-gradient(135deg, var(--route-500) 0%, var(--sky-500) 55%, var(--pickup-500) 100%);
  --gradient-route-soft: linear-gradient(135deg, var(--route-100) 0%, var(--sky-100) 55%, var(--pickup-100) 100%);

  /* --- Type ----------------------------------------------------------------
     Display: Space Grotesk — the geometric, slightly technical face that
     carries the Nimbus wordmark and section labels. Body/UI: Inter. Data:
     IBM Plex Mono for fare, distance and duration, so the numbers a rider
     is trusting with money feel measured and receipt-like.
  ------------------------------------------------------------------------- */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-data: 'IBM Plex Mono', 'Consolas', monospace;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 56px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(15,23,42,0.04), 0 16px 40px rgba(15,23,42,0.08);
  --shadow-float: 0 24px 60px rgba(15,23,42,0.18);
  --shadow-focus: 0 0 0 4px var(--route-100);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(760px 420px at 100% -10%, var(--sky-100) 0%, rgba(223,246,255,0) 60%),
    radial-gradient(700px 380px at -10% 0%, var(--route-100) 0%, rgba(233,237,252,0) 55%),
    var(--cloud-50);
  color: var(--ink-950);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Shell / header
   ========================================================================== */

.app-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-5) var(--sp-9);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-7);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: var(--sp-3); }
.brand-mark { width: 46px; height: 46px; flex-shrink: 0; filter: drop-shadow(0 6px 14px rgba(59,91,219,0.25)); }
.brand-text h1 { font-size: 1.55rem; font-weight: 700; }
.brand-text p { margin: 2px 0 0; font-size: 0.8125rem; color: var(--ink-400); font-weight: 500; }

.trust-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--cloud-0);
  border: 1px solid var(--ink-200);
  color: var(--route-600);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
}

.trust-chip i { color: var(--pickup-500); }

/* ==========================================================================
   Booking layout — form panel beside a full-bleed live map
   ========================================================================== */

.booking-layout {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  gap: var(--sp-6);
  align-items: start;
}

@media (max-width: 960px) {
  .booking-layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--cloud-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--ink-200);
}

.booking-panel { padding: var(--sp-7); }

.panel-section + .panel-section {
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--ink-200);
}

.panel-section h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-400);
  margin-bottom: var(--sp-4);
}

.panel-section h2 i { font-size: 0.9rem; color: var(--route-500); }

/* --- Form fields -------------------------------------------------------- */

.field { margin-bottom: var(--sp-4); }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-800);
  margin-bottom: var(--sp-2);
}

.field .required::after { content: " *"; color: var(--dest-500); }

.address-wrap { position: relative; }

.input-icon-wrap { position: relative; }

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.15s var(--ease);
}

.input-icon-wrap:focus-within .input-icon { color: var(--route-500); }

input[type="text"], input[type="tel"], input[type="date"], input[type="time"], input.text-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 13px var(--sp-4);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink-200);
  background: var(--cloud-50);
  color: var(--ink-950);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

input.has-icon { padding-left: 42px; }

input::placeholder { color: var(--ink-400); }

input[type="text"]:hover, input[type="tel"]:hover,
input[type="date"]:hover, input[type="time"]:hover { border-color: var(--ink-400); }

input[type="text"]:focus, input[type="tel"]:focus,
input[type="date"]:focus, input[type="time"]:focus {
  outline: none;
  background: var(--cloud-0);
  border-color: var(--route-500);
  box-shadow: var(--shadow-focus);
}

.field.invalid input { border-color: var(--dest-500); background: var(--dest-100); }

.field-error {
  font-size: 0.75rem;
  color: var(--dest-500);
  margin-top: var(--sp-2);
  display: none;
  align-items: center;
  gap: 4px;
}

.field.invalid .field-error { display: flex; }

/* --- Route stepper -------------------------------------------------------*/

.route-field { position: relative; padding-left: 28px; }

.route-field::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 22px;
  bottom: -14px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--ink-200) 0 4px, transparent 4px 8px);
}

.route-field:last-of-type::before { display: none; }

.route-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2.5px solid var(--cloud-0);
  box-shadow: 0 0 0 1.5px var(--ink-200);
}

.route-dot.pickup { background: var(--pickup-500); box-shadow: 0 0 0 1.5px var(--pickup-500); }
.route-dot.destination { background: var(--dest-500); box-shadow: 0 0 0 1.5px var(--dest-500); }

/* --- Address autocomplete ------------------------------------------------ */

.suggestions-list {
  list-style: none;
  margin: var(--sp-2) 0 0;
  padding: var(--sp-2);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--cloud-0);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 1500;
  box-shadow: var(--shadow-float);
  display: none;
}

.suggestions-list.show { display: block; }

.suggestions-list li {
  padding: var(--sp-3);
  font-size: 0.8125rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--ink-950);
}

.suggestions-list li:hover, .suggestions-list li.active { background: var(--route-100); }
.suggestions-list li div { font-weight: 600; }
.suggestions-list li small { display: block; color: var(--ink-400); margin-top: 2px; }

.suggestions-loading {
  display: flex; align-items: center; gap: var(--sp-2);
  color: var(--ink-400); cursor: default !important;
}
.suggestions-loading:hover { background: transparent !important; }

/* --- Locate-me chip ------------------------------------------------------ */

.locate-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pickup-100);
  color: #0B7A4E;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease);
  white-space: nowrap;
}

.locate-chip:hover { background: #CFF3E3; transform: translateY(-1px); }
.locate-chip:active { transform: translateY(0); }
.locate-chip[disabled] { opacity: 0.6; cursor: wait; transform: none; }

.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.field-header label { margin-bottom: 0; }

/* --- Ride time: dual choice cards + conditional date/time fields -------- */

.schedule-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.schedule-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.schedule-toggle label {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--ink-200);
  background: var(--cloud-50);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.12s var(--ease);
}

.schedule-toggle label i {
  font-size: 1.05rem;
  color: var(--ink-400);
  margin-top: 2px;
  transition: color 0.15s var(--ease);
}

.schedule-toggle .toggle-copy { display: flex; flex-direction: column; gap: 2px; }
.schedule-toggle .toggle-copy strong { font-size: 0.875rem; color: var(--ink-950); font-weight: 700; }
.schedule-toggle .toggle-copy small { font-size: 0.75rem; color: var(--ink-400); font-weight: 500; line-height: 1.3; }

.schedule-toggle label:hover { border-color: var(--route-500); transform: translateY(-1px); }

.schedule-toggle input:checked + label {
  background: var(--route-100);
  border-color: var(--route-500);
  box-shadow: 0 8px 20px rgba(59,91,219,0.14);
}

.schedule-toggle input:checked + label i { color: var(--route-600); }

.schedule-toggle input:focus-visible + label { box-shadow: var(--shadow-focus); }

.schedule-fields {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.schedule-fields.show { display: grid; }

.schedule-fields .field { margin-bottom: 0; }
.schedule-error { grid-column: 1 / -1; }

/* --- Buttons -------------------------------------------------------------*/

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  padding: 15px var(--sp-5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: transform 0.12s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s var(--ease);
}

.btn-primary {
  width: 100%;
  background: var(--gradient-route);
  background-size: 160% 160%;
  background-position: 0% 50%;
  color: #fff;
  box-shadow: 0 10px 24px rgba(59,91,219,0.28);
}
.btn-primary:hover:not(:disabled) { background-position: 100% 50%; box-shadow: 0 12px 28px rgba(0,194,255,0.32); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { background: var(--ink-200); color: var(--ink-400); cursor: not-allowed; box-shadow: none; }

.form-footnote {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin: var(--sp-3) 0 0;
  font-size: 0.75rem;
  color: var(--ink-400);
}

.spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Map panel
   ========================================================================== */

.map-panel { position: relative; overflow: hidden; padding: 0; }

#map { height: 700px; width: 100%; z-index: 1; background: var(--cloud-50); }

@media (max-width: 960px) { #map { height: 420px; } }

.map-toggle {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 1000;
  background: var(--cloud-0);
  border-radius: var(--radius-pill);
  padding: 4px;
  display: flex;
  gap: 4px;
  box-shadow: var(--shadow-float);
}

.map-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.map-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-400);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.map-toggle input:checked + label.pickup { background: var(--pickup-100); color: #0B7A4E; }
.map-toggle input:checked + label.destination { background: var(--dest-100); color: #C0281C; }

.map-toggle label .swatch { width: 8px; height: 8px; border-radius: 50%; }
.map-toggle label.pickup .swatch { background: var(--pickup-500); }
.map-toggle label.destination .swatch { background: var(--dest-500); }
.map-toggle label:focus-within { box-shadow: var(--shadow-focus); }

/* Restyle Leaflet's own zoom control to match the Nimbus card language */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-float) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
  color: var(--ink-800) !important;
  background: var(--cloud-0) !important;
}
.leaflet-control-zoom a:hover { background: var(--cloud-50) !important; }

/* Trust badge floating on the lower-left of the map */
.map-trust-badge {
  position: absolute;
  left: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--cloud-0);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-float);
  max-width: 240px;
}
.map-trust-badge i {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--pickup-100);
  color: #0B7A4E;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.map-trust-badge strong { display: block; font-size: 0.8125rem; color: var(--ink-950); }
.map-trust-badge small { display: block; font-size: 0.75rem; color: var(--ink-400); }

@media (max-width: 700px) { .map-trust-badge { display: none; } }

/* ==========================================================================
   Trip result — floats over the map like a live trip-planner readout
   ========================================================================== */

.result-region {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: 1000;
  width: 300px;
  max-width: calc(100% - var(--sp-8));
}

.result-idle {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  color: var(--ink-600);
  font-size: 0.8125rem;
  background: var(--cloud-0);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
}
.result-idle i { color: var(--route-500); flex-shrink: 0; }

.result-card { display: none; padding: var(--sp-5); box-shadow: var(--shadow-float); }
.result-card.show { display: block; }
.result-card.state-error { border-color: var(--dest-500); }

.result-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }

.result-head .icon-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.state-success .result-head .icon-circle { background: var(--pickup-100); color: #0B7A4E; }
.state-error .result-head .icon-circle { background: var(--dest-100); color: var(--dest-500); }

.result-head h3 { font-size: 1rem; }
.result-head p { margin: 2px 0 0; font-size: 0.75rem; color: var(--ink-400); }

.trip-stats {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.trip-stat {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--cloud-50);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
}

.trip-stat-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--route-100);
  color: var(--route-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
}

.trip-stat .label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  font-weight: 700;
}

.trip-stat .value {
  font-family: var(--font-data);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink-950);
  margin-top: 2px;
}

.trip-badges { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-pending { background: var(--amber-100); color: #93590A; }
.badge-confirmed { background: var(--route-100); color: var(--route-600); }
.badge-completed { background: var(--pickup-100); color: #0B7A4E; }
.badge-cancelled, .badge-unpaid { background: var(--dest-100); color: #C0281C; }
.badge-paid { background: var(--pickup-100); color: #0B7A4E; }
.badge-neutral { background: var(--cloud-50); color: var(--ink-600); }

.result-error-msg {
  font-size: 0.875rem;
  color: #C0281C;
  background: var(--dest-100);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
}

/* On narrower layouts the map shrinks below the form, so let the result
   card sit inline underneath the map instead of floating over it. */
@media (max-width: 960px) {
  .result-region {
    position: static;
    width: auto;
    max-width: none;
    margin: var(--sp-4);
  }
}

/* ==========================================================================
   Responsive tightening
   ========================================================================== */

@media (max-width: 600px) {
  .app-shell { padding: var(--sp-4) var(--sp-4) var(--sp-7); }
  .booking-panel { padding: var(--sp-5); }
  .schedule-toggle { grid-template-columns: 1fr; }
  .schedule-fields { grid-template-columns: 1fr; }
  .trust-chip { font-size: 0.75rem; padding: 8px 14px; }
}
/* Add to nimbus-booking.css — sizes the header logo image */
.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 80px;      /* adjust to match your header height */
  width: auto;
  display: block;
}