@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  --bg: #0b0d11;
  --panel: #13161d;
  --panel-soft: #191d26;
  --panel-hover: #202630;
  --line: #292f3a;
  --muted: #89919f;
  --muted-2: #626b79;
  --text: #f4f7f6;
  --green: #59e391;
  --green-dark: #1eb969;
  --amber: #f4bd54;
  --red: #fa7777;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 32px 18px;
}

.topbar, .viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 3;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--bg);
  background: var(--green);
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 20px;
  transform: rotate(-7deg);
  box-shadow: 0 8px 22px rgba(89, 227, 145, .18);
}

.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-copy strong { font: 800 20px/1 'Manrope', sans-serif; letter-spacing: -.05em; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: .05em; }

.live-pill, .secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(89, 227, 145, .16);
  border-radius: 999px;
  background: rgba(89, 227, 145, .06);
  color: #b4eac9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.live-dot, .secure-dot, .location-pulse {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(89, 227, 145, .12);
}

.booking-layout {
  display: grid;
  grid-template-columns: minmax(420px, 490px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 28px;
  align-items: stretch;
}

.form-panel {
  min-width: 0;
  padding: 25px 26px 26px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(26, 30, 39, .98), rgba(17, 20, 27, .98));
  box-shadow: var(--shadow);
}

.section-kicker {
  display: block;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}

.form-panel > h1 {
  margin: 10px 0 9px;
  font: 800 clamp(27px, 3vw, 39px)/1.05 'Manrope', sans-serif;
  letter-spacing: -.065em;
}

.form-panel > h1 span { color: var(--muted); }
.section-intro { max-width: 380px; margin: 0 0 25px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.form-section {
  padding: 18px 0 19px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.final-section { padding-bottom: 8px; }
.section-heading { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 15px; }
.step-number { color: var(--green); font: 700 10px/1 'Manrope', sans-serif; letter-spacing: .08em; padding-top: 3px; }
.section-heading h2 { margin: 0 0 3px; font: 700 14px/1 'Manrope', sans-serif; letter-spacing: -.02em; }
.section-heading p { margin: 0; color: var(--muted-2); font-size: 11px; }

.field-grid { display: grid; gap: 12px; }
.two-up { grid-template-columns: 1fr 1fr; }
.field-group { min-width: 0; }
.field-group label, .location-field label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #aeb6c1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.unit-label { color: var(--muted-2); font-size: 9px; }

input[type="text"], input[type="number"], select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: rgba(8, 10, 14, .62);
  color: var(--text);
  font-size: 12px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: #586170; }
input:focus, select:focus { border-color: rgba(89, 227, 145, .65); box-shadow: 0 0 0 3px rgba(89, 227, 145, .1); background: rgba(8, 10, 14, .85); }
select { appearance: auto; cursor: pointer; }

.rating-control { display: flex; align-items: center; height: 42px; gap: 2px; }
.rating-control button { border: 0; padding: 0 2px; background: none; color: #39404c; cursor: pointer; font-size: 20px; line-height: 1; transition: color .2s, transform .2s; }
.rating-control button:hover { transform: translateY(-2px); }
.rating-control button.active { color: var(--amber); }

.location-stack { position: relative; }
.location-field { display: flex; gap: 10px; position: relative; }
.location-field-content { flex: 1; min-width: 0; }
.location-marker, .legend-dot, .summary-marker {
  display: block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 31px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--green);
  background: var(--green);
}
.dropoff-marker { border-radius: 3px; background: var(--red); box-shadow: 0 0 0 2px var(--red); }
.saved-select { margin-bottom: 8px; min-height: 36px !important; border-radius: 8px !important; color: #d6f6e1 !important; background: rgba(89, 227, 145, .06) !important; }
.loc-row { display: flex; gap: 7px; }
.loc-row input { flex: 1; min-width: 0; }
.icon-btn { display: grid; flex: 0 0 42px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); color: var(--green); cursor: pointer; transition: background .2s, transform .2s; }
.icon-btn:hover { background: var(--panel-hover); transform: translateY(-1px); }
.icon-btn svg, .primary-btn svg, .whatsapp-btn svg, .viewer-share-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.route-connector { width: 1px; height: 13px; margin: 0 0 0 4px; background: var(--line); }

.suggestions { display: none; position: relative; z-index: 5; margin-top: 4px; max-height: 140px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; background: #11151b; box-shadow: var(--shadow); }
.suggestions div { padding: 10px 11px; border-bottom: 1px solid rgba(255,255,255,.05); color: #ccd2da; cursor: pointer; font-size: 11px; line-height: 1.3; }
.suggestions div:last-child { border-bottom: 0; }
.suggestions div:hover { background: var(--panel-hover); color: var(--green); }

.saved-location-tools { margin: 11px 0 0 20px; }
.text-button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--green); cursor: pointer; font-size: 11px; font-weight: 700; }
.plus-icon { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid rgba(89, 227, 145, .5); border-radius: 50%; font-size: 15px; font-weight: 400; line-height: 1; }
.saved-location-form { margin-top: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.15); }
.saved-grid { grid-template-columns: 1.1fr .8fr .8fr auto; align-items: center; }
.saved-grid input { min-height: 35px; font-size: 11px; }
.small-button { min-height: 35px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--green); color: var(--bg); cursor: pointer; font-size: 11px; font-weight: 800; }
.inline-message { min-height: 0; margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.hidden { display: none !important; }

.form-status { min-height: 15px; margin: 6px 0 0; color: var(--red); font-size: 11px; }
.primary-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; margin-top: 5px; padding: 0 16px 0 18px; border: 0; border-radius: 12px; background: var(--green); color: var(--bg); cursor: pointer; font-size: 12px; font-weight: 800; box-shadow: 0 10px 25px rgba(89, 227, 145, .14); transition: transform .2s, background .2s, box-shadow .2s; }
.primary-btn:hover { background: #73eca4; box-shadow: 0 13px 30px rgba(89, 227, 145, .2); transform: translateY(-1px); }
.primary-btn:disabled { cursor: wait; opacity: .7; transform: none; }
.primary-btn svg { width: 19px; height: 19px; stroke-width: 2.2; }

.link-result { margin-top: 15px; padding: 14px; border: 1px solid rgba(89, 227, 145, .24); border-radius: 13px; background: rgba(89, 227, 145, .055); animation: reveal .35s ease both; }
.success-heading { display: flex; align-items: center; gap: 9px; }
.success-heading strong, .success-heading small { display: block; }
.success-heading strong { font-size: 12px; }
.success-heading small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.success-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: var(--green); color: var(--bg); font-weight: 900; }
.link-box { display: flex; gap: 6px; margin: 12px 0 8px; }
.link-box input { min-width: 0; height: 35px; color: #b9efcc; font-size: 10px; }
.link-box button { flex: 0 0 auto; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); color: var(--text); cursor: pointer; font-size: 10px; font-weight: 700; }
.whatsapp-btn, .viewer-share-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; border-radius: 9px; background: #32d875; color: #06120b; text-decoration: none; font-size: 11px; font-weight: 800; transition: background .2s, transform .2s; }
.whatsapp-btn:hover, .viewer-share-button:hover { background: #5ae898; transform: translateY(-1px); }
.whatsapp-btn svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }

.map-panel { position: relative; min-width: 0; min-height: 700px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 24px; background: #1e2427; box-shadow: var(--shadow); }
#map { position: absolute; inset: 0; }
.map-overlay { position: absolute; z-index: 2; }
.map-header { top: 17px; left: 17px; right: 17px; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; background: rgba(14, 18, 23, .75); backdrop-filter: blur(12px); }
.map-label { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.map-location { display: flex; align-items: center; gap: 8px; color: #d8dee5; font-size: 10px; }
.map-location .location-pulse { width: 5px; height: 5px; box-shadow: none; }
.map-legend { right: 17px; bottom: 17px; display: flex; gap: 13px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 9px; background: rgba(14, 18, 23, .75); backdrop-filter: blur(12px); color: #d8dee5; font-size: 10px; }
.map-legend div { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 7px; height: 7px; margin: 0; border: 0; box-shadow: none; }
.map-empty-state { position: absolute; z-index: 1; top: 50%; left: 50%; display: flex; flex-direction: column; align-items: center; gap: 7px; transform: translate(-50%, -50%); padding: 16px 20px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(12, 15, 19, .8); backdrop-filter: blur(10px); text-align: center; pointer-events: none; transition: opacity .3s; }
.map-empty-state.has-route { opacity: 0; }
.map-empty-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid rgba(89, 227, 145, .5); border-radius: 50%; color: var(--green); font-size: 19px; line-height: 1; }
.map-empty-state strong { font: 700 12px 'Manrope', sans-serif; }
.map-empty-state small { color: var(--muted); font-size: 10px; }
.location-pin { display: grid; place-items: center; border: 0; background: transparent; }
.location-pin span { display: block; width: 14px; height: 14px; border: 3px solid #0b0d11; border-radius: 50% 50% 50% 0; box-shadow: 0 2px 7px rgba(0,0,0,.4); transform: rotate(-45deg); }
.vehicle-map-marker { background: transparent; border: 0; }
.vehicle-map-marker > div { width: 42px; height: 42px; transform-origin: center; }
.leaflet-container { font-family: 'DM Sans', sans-serif; }
.leaflet-control-zoom a { background: rgba(15, 18, 24, .86) !important; color: #e5e9ed !important; border-color: rgba(255,255,255,.12) !important; }
.leaflet-control-attribution { background: rgba(15,18,24,.72) !important; color: #aab3bd !important; }
.leaflet-control-attribution a { color: #b9efcc !important; }
.site-footer { padding: 13px 0 0; color: var(--muted-2); font-size: 10px; text-align: right; }

@keyframes reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* Live ride viewer */
.viewer-page { overflow: hidden; }
.viewer-shell { position: relative; isolation: isolate; min-height: 100vh; }
.viewer-shell #viewerMap { position: absolute; z-index: 0; inset: 0; background: #1e2427; }
.viewer-topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 1000; padding: 19px 25px 60px; background: linear-gradient(180deg, rgba(8,10,13,.9), transparent); pointer-events: none; }
.viewer-topbar .brand { pointer-events: auto; }
.viewer-topbar .brand-mark { width: 33px; height: 33px; border-radius: 10px; font-size: 17px; }
.viewer-topbar .brand-copy strong { font-size: 17px; }
.secure-pill { pointer-events: auto; color: #d6ebde; }
.ride-info { position: absolute; z-index: 1000; left: 25px; bottom: 25px; width: min(405px, calc(100vw - 50px)); padding: 21px; border: 1px solid rgba(255,255,255,.1); border-radius: 20px; background: rgba(15, 18, 24, .9); backdrop-filter: blur(18px); box-shadow: 0 18px 55px rgba(0,0,0,.35); animation: reveal .45s ease both; }
.ride-sheet-handle { display: none; width: 100%; min-height: 20px; margin: -10px 0 2px; padding: 8px; border: 0; background: transparent; cursor: pointer; }
.ride-sheet-handle span { display: block; width: 42px; height: 4px; margin: auto; border-radius: 999px; background: rgba(255,255,255,.28); }
.ride-card-top, .driver-row, .trip-stats { display: flex; align-items: center; justify-content: space-between; gap: 13px; }
.ride-card-top h1 { margin: 5px 0 0; font: 700 21px 'Manrope', sans-serif; letter-spacing: -.04em; }
.status-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 10px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-enroute { background: rgba(244,189,84,.16); color: var(--amber); }
.status-waiting { background: rgba(116,180,255,.16); color: #8fc3ff; }
.status-arrived { background: rgba(89,227,145,.16); color: var(--green); }
.status-expired { background: rgba(255,255,255,.1); color: #b1b8c1; }
.driver-row { justify-content: flex-start; margin-top: 20px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,.07); border-bottom: 1px solid rgba(255,255,255,.07); }
.driver-avatar { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; background: linear-gradient(145deg, var(--green), #2eae70); color: var(--bg); font: 800 16px 'Manrope', sans-serif; }
.driver-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.driver-copy strong { font-size: 13px; }
.driver-copy span { color: var(--muted); font-size: 10px; }
.rating-star { color: var(--amber) !important; }
.vehicle-copy { display: flex; flex-direction: column; gap: 4px; text-align: right; }
.vehicle-label, .stat-label, .summary-label { color: var(--muted-2); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.vehicle-copy strong { max-width: 150px; color: #d7dce2; font-size: 10px; font-weight: 600; }
.route-summary { padding: 16px 0 14px; }
.route-summary-line { display: flex; align-items: center; gap: 11px; }
.summary-marker { width: 9px; height: 9px; margin: 0 0 0 1px; }
.route-summary-line div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.route-summary-line strong { overflow: hidden; max-width: 315px; color: #e5e9ed; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.summary-connector { width: 1px; height: 15px; margin: 2px 0 2px 5px; background: var(--line); }
.trip-stats { align-items: stretch; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.07); }
.trip-stats > div { display: flex; flex: 1; flex-direction: column; gap: 5px; }
.trip-stats > div + div { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.07); }
.trip-stats strong { color: #e5e9ed; font-size: 11px; }
.viewer-share-button { min-height: 37px; margin-top: 3px; }
.not-found { position: absolute; z-index: 1000; top: 50%; left: 50%; width: min(360px, calc(100vw - 40px)); transform: translate(-50%, -50%); padding: 28px; border: 1px solid rgba(255,255,255,.1); border-radius: 20px; background: rgba(15, 18, 24, .92); text-align: center; box-shadow: var(--shadow); }
.ride-ended { position: absolute; z-index: 1100; top: 50%; left: 50%; width: min(380px, calc(100vw - 40px)); transform: translate(-50%, -50%); padding: 31px; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; background: rgba(15, 18, 24, .95); text-align: center; box-shadow: var(--shadow); }
.ride-ended-mark { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 16px; background: rgba(89,227,145,.14); color: var(--green); font: 800 23px 'Manrope', sans-serif; }
.ride-ended h2 { margin: 10px 0 8px; font: 700 22px 'Manrope', sans-serif; letter-spacing: -.04em; }
.ride-ended p { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.ended-download-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; width: 100%; border-radius: 10px; background: var(--green); color: var(--bg); text-decoration: none; font-size: 12px; font-weight: 800; }
.not-found-mark { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 15px; border-radius: 14px; background: rgba(250,119,119,.13); color: var(--red); font: 800 22px 'Manrope', sans-serif; }
.not-found h2 { margin: 10px 0 7px; font: 700 19px 'Manrope', sans-serif; letter-spacing: -.04em; }
.not-found p { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.back-home-button { display: inline-flex; min-height: 36px; align-items: center; padding: 0 13px; border-radius: 9px; background: var(--green); color: var(--bg); text-decoration: none; font-size: 11px; font-weight: 800; }

@media (max-width: 980px) {
  .app-shell { padding: 20px; }
  .booking-layout { grid-template-columns: minmax(370px, 440px) minmax(0, 1fr); gap: 16px; }
  .form-panel { padding: 22px; }
  .map-panel { min-height: 650px; }
}

@media (max-width: 760px) {
  .app-shell { padding: 16px 12px; }
  .topbar { padding: 0 3px; }
  .live-pill { padding: 7px 9px; font-size: 9px; }
  .brand-copy small { display: none; }
  .booking-layout { display: flex; flex-direction: column; margin-top: 17px; }
  .map-panel { order: -1; min-height: 320px; height: 42vh; max-height: 390px; border-radius: 19px; }
  .form-panel { border-radius: 19px; padding: 20px 17px; }
  .form-panel > h1 { font-size: 30px; }
  .two-up { grid-template-columns: 1fr 1fr; }
  .saved-grid { grid-template-columns: 1fr 1fr; }
  .saved-grid input:first-child { grid-column: span 2; }
  .saved-grid .small-button { width: 100%; }
  .site-footer { padding-right: 4px; text-align: center; }
  .viewer-topbar { padding: 14px 14px 70px; }
  .ride-info { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 17px; border-radius: 17px; transition: max-height .3s ease, padding .3s ease; }
  .ride-sheet-handle { display: block; }
  .ride-info.is-collapsed { max-height: 112px; overflow: hidden; padding-top: 11px; }
  .ride-info.is-collapsed .ride-card-top,
  .ride-info.is-collapsed .route-summary,
  .ride-info.is-collapsed .trip-stats,
  .ride-info.is-collapsed .viewer-share-button { display: none; }
  .ride-info.is-collapsed .driver-row { margin-top: 2px; border-bottom: 0; }
  .ride-card-top h1 { font-size: 19px; }
  .route-summary-line strong { max-width: calc(100vw - 95px); }
}

@media (max-width: 390px) {
  .two-up { grid-template-columns: 1fr; }
  .rating-control { height: 32px; }
  .location-marker { margin-top: 31px; }
  .map-header { left: 10px; right: 10px; top: 10px; }
  .map-location { display: none; }
  .ride-info { padding: 15px; }
  .vehicle-copy strong { max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}