/* Booking page — a focused form beside a full-height map. */

.booking-grid {
  display: grid;
  grid-template-columns: minmax(400px, 480px) 1fr;
  gap: 24px;
  align-items: start;
}

/* Keep the form (and its companion × buttons / address dropdown) above the
   sticky map column, which is a later, positioned sibling and would otherwise
   paint over the form's right edge at narrow widths. */
.booking-grid > section { position: relative; }
.booking-grid > section.d1 { z-index: 2; }
.map-col { position: sticky; top: 92px; z-index: 1; }
#map { height: min(78vh, 720px); }
.map-col .map-frame { border-radius: 18px; box-shadow: 0 1px 2px rgba(13, 32, 27, 0.04), 0 18px 44px -20px rgba(13, 32, 27, 0.22); }

.form-head { margin: 0 0 10px; }
.form-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 3.2vw, 29px);
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--ink);
}
.form-head p {
  margin: 6px 0 0;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.route-hint {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--pine-deep);
  margin: 14px 0 18px;
  padding: 11px 14px;
  background: linear-gradient(180deg, var(--pine-soft), rgba(226, 240, 236, 0.45));
  border: 1px solid rgba(14, 107, 90, 0.18);
  border-radius: 12px;
}
.route-hint::before {
  content: '📍';
  font-size: 14px;
  line-height: 1.35;
  flex: none;
}

.group-label {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 22px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

#submit-btn {
  margin-top: 6px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 15px 22px;
  min-height: 52px;
  border-radius: 13px;
}

/* ── Trip-direction segmented control ── */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--linen-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.seg {
  appearance: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 6px;
  min-height: 40px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.seg:hover { color: var(--ink); }
.seg.active {
  color: var(--pine-deep);
  background: #fff;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.seg:focus-visible { outline: 2.5px solid var(--pine); outline-offset: 2px; }

/* ── Return trip toggle ── */
.toggle-field { margin-top: 14px; }
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  background: var(--linen-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}
.switch input:checked + .switch-track { background: var(--pine); border-color: var(--pine); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2.5px solid var(--pine); outline-offset: 2px; }
.switch-label { font-weight: 500; }

/* ── Companions ── */
.companions-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.companion-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
/* Both inputs must be allowed to shrink (min-width:0), otherwise the fixed
   32px remove button gets pushed past the panel padding and pokes out. */
.companion-row .companion-kind { flex: 1 1 130px; min-width: 0; }
.companion-row .companion-name { flex: 1 1 0; min-width: 0; }
.companion-remove {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-faint);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.companion-remove:hover { color: var(--clay); border-color: var(--clay); }

/* ── Suggestions dropdown ── */
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1100;
  background: #fff;
  border: 1px solid var(--pine);
  border-top: none;
  border-radius: 0 0 9px 9px;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  box-shadow: var(--shadow-md);
}
.suggestions li {
  padding: 10px 13px;
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 1px solid var(--hairline);
}
.suggestions li:last-child { border-bottom: none; border-radius: 0 0 8px 8px; }
.suggestions li:hover { background: var(--pine-soft); }
.suggestions:empty { display: none; }

/* ── Fare quote ── */
.quote {
  display: none;
  position: relative;
  border: 1px solid rgba(14, 107, 90, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, #effaf6, #ffffff 80%);
  padding: 16px 18px 14px;
  margin: 8px 0 4px;
  box-shadow: 0 1px 2px rgba(13, 32, 27, 0.04), 0 12px 28px -18px rgba(14, 107, 90, 0.45);
  overflow: hidden;
}
.quote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--pine), var(--pine-deep));
}
.quote.visible { display: block; animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.quote-figures { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.quote-fare {
  font-family: var(--display);
  font-weight: 750;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--pine-deep);
}
.quote-fare .cur { font-size: 17px; font-weight: 600; color: var(--ink-soft); margin-right: 3px; }
.quote-meta { text-align: right; font-size: 13.5px; color: var(--ink-soft); }
.quote-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 8px; }

/* ── Confirmation ── */
.confirm-card { display: none; }
.confirm-card.visible { display: block; animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

.ok-circle { display: flex; justify-content: center; margin: 6px 0 10px; }
.ok-circle svg { width: 72px; height: 72px; }
.ok-circle circle {
  fill: none;
  stroke: var(--pine);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 160;
  animation: drawRing 0.7s ease-out both;
}
.ok-circle path {
  fill: none;
  stroke: var(--pine);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  animation: drawCheck 0.45s ease-out 0.5s both;
}
.ok-circle.pending circle { stroke: var(--ochre); }
.ok-circle.pending path { display: none; }
.ok-circle .dots {
  fill: var(--ochre);
  stroke: none;
  animation: rise 0.45s ease-out 0.45s both;
}

.confirm-line {
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 2px;
}
.confirm-card .explain {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 8px auto 0;
  max-width: 44ch;
}

.confirm-ref-label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-top: 18px;
}
.confirm-ref {
  text-align: center;
  font-family: var(--display);
  font-weight: 750;
  font-size: 30px;
  letter-spacing: 0.04em;
  color: var(--pine-deep);
  margin: 2px 0 14px;
}

/* ── Multi-leg confirmation ── */
.confirm-legs { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.leg-card {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px 4px;
  background: var(--linen);
}
.leg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.leg-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pine-deep);
}
.leg-driver { font-size: 13.5px; color: var(--ink-soft); }
.leg-card .confirm-rows { margin-top: 10px; }
.leg-card .confirm-rows .row:last-child { border-bottom: none; }

.confirm-rows { border-top: 1px solid var(--hairline); margin-top: 16px; }
.confirm-rows .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}
.confirm-rows .row b { text-align: right; font-weight: 600; }

@media (max-width: 960px) {
  .booking-grid { grid-template-columns: 1fr; }
  .map-col { position: static; }
  #map { height: 380px; }
}
