:root {
  color-scheme: dark;
  --bg-black: #09090b;
  --sheet-bg: #121318;
  --card-bg: #1a1c24;
  --card-hover: #222530;
  --border: #2a2e3b;
  --border-active: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-strong: #0284c7;
  --uber-white: #ffffff;
  --uber-black: #09090b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --assertive: #f97316;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-lg: 0 -10px 40px rgba(0, 0, 0, 0.65);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-black);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Map Fullscreen Layer */
#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 1;
  background: #0d1017;
}

/* Top Floating Bar */
.top-bar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.brand-pill, .user-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(18, 19, 24, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 7px 13px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.brand-pill img {
  width: 26px;
  height: 26px;
}

.brand-name {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-dot.offline {
  background: var(--text-muted);
  box-shadow: none;
}

.user-pill {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 6px;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Login Gate Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 50% 20%, rgba(14, 165, 233, 0.16), rgba(9, 9, 11, 0.96) 65%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--sheet-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  text-align: center;
}

.login-logo {
  width: 68px;
  height: 68px;
  margin-bottom: 12px;
}

.login-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-sub {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 4px;
  margin-bottom: 22px;
}

.field-group {
  text-align: left;
  margin-bottom: 14px;
}

.field-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.text-input {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.text-input:focus {
  border-color: var(--accent);
}

.error-box {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.84rem;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  text-align: left;
}

/* Bottom Sheet (Uber-Style) */
.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  max-height: 55dvh;
  background: var(--sheet-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

@media (min-width: 760px) {
  .bottom-sheet {
    left: 20px;
    right: auto;
    bottom: 20px;
    width: 420px;
    max-height: calc(100dvh - 90px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
  }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  margin: 10px auto 6px;
  flex-shrink: 0;
}

.sheet-scroll {
  overflow-y: auto;
  padding: 6px 18px 10px;
  overscroll-behavior: contain;
}

.sheet-footer {
  padding: 10px 18px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--sheet-bg);
  flex-shrink: 0;
}

/* Banners */
.battery-banner {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
  font-size: 0.8rem;
  border-radius: 11px;
  padding: 9px 12px;
  margin-bottom: 12px;
}

.offline-banner {
  background: rgba(148, 163, 184, 0.13);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
  font-size: 0.83rem;
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

/* Search + GPS Row */
.pickup-row {
  display: flex;
  gap: 8px;
  position: relative;
  margin-bottom: 10px;
}

.search-wrap {
  flex: 1;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 12px 12px 12px 36px;
  font-size: 0.93rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-pin-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  pointer-events: none;
}

.gps-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: var(--radius-md);
  padding: 0 13px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.gps-btn:active {
  transform: scale(0.97);
}

/* Autocomplete Dropdown */
.suggestions-list {
  background: #181a22;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.suggestion-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  padding: 10px 12px;
  cursor: pointer;
  display: block;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: var(--card-hover);
}

.suggestion-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.suggestion-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Smart Pickup Spots */
.spots-section {
  margin-bottom: 12px;
}

.section-caption {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.spots-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.spots-scroll::-webkit-scrollbar {
  display: none;
}

.spot-chip {
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 7px 11px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.spot-chip.active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
}

.spot-chip-title {
  font-size: 0.8rem;
  font-weight: 600;
}

.spot-chip-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Ride Modes (UberX / Black Style) */
.modes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.mode-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 11px 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-align: left;
  color: var(--text-primary);
  width: 100%;
}

.mode-card.selected {
  border-color: var(--uber-white);
  background: #202430;
}

.mode-card.assertive.selected {
  border-color: var(--assertive);
  background: rgba(249, 115, 22, 0.11);
}

.mode-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.mode-info {
  flex: 1;
  min-width: 0;
}

.mode-title {
  font-size: 0.93rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.mode-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* Extras Chips */
.extras-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.extra-chip {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.extra-chip.selected {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-primary);
}

.note-input {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 0.83rem;
  margin-bottom: 8px;
  outline: none;
}

/* Payment Selector Bar (Uber Style) */
.payment-selector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 10px;
  cursor: pointer;
}

.payment-current {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.payment-change {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.payment-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.pay-option-btn {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 9px 6px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
}

.pay-option-btn.selected {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.14);
}

.pay-emoji {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 3px;
}

/* Primary Buttons */
.primary-btn {
  width: 100%;
  background: var(--uber-white);
  color: var(--uber-black);
  border: none;
  border-radius: 14px;
  padding: 15px 18px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-btn:not(:disabled):active {
  transform: scale(0.985);
}

.secondary-btn {
  width: 100%;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}

/* Active Ride & Live Tracking Views */
.ride-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ride-status-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.ride-status-sub {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.eta-box {
  background: var(--accent);
  color: #04131d;
  border-radius: 14px;
  padding: 8px 14px;
  text-align: center;
  min-width: 72px;
  flex-shrink: 0;
}

.eta-box.arrived {
  background: var(--success);
  color: #031c12;
}

.eta-num {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.05;
}

.eta-unit {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pulse-bar {
  height: 4px;
  width: 100%;
  background: rgba(56, 189, 248, 0.18);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
  position: relative;
}

.pulse-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  animation: slidePulse 1.4s infinite ease-in-out;
}

@keyframes slidePulse {
  0% { left: -40%; }
  100% { left: 100%; }
}

.driver-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px;
  margin-bottom: 12px;
}

.driver-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.driver-meta {
  flex: 1;
}

.driver-name-line {
  font-weight: 700;
  font-size: 0.96rem;
}

.driver-car-line {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.rating-pill {
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.summary-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 13px;
  font-size: 0.83rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-line strong {
  color: var(--text-primary);
}

/* Rating View */
.stars-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0;
}

.star-btn {
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.3;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.star-btn.active {
  opacity: 1;
  transform: scale(1.08);
}

/* Map Custom Markers */
.pickup-marker {
  width: 26px;
  height: 26px;
  background: #09090b;
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
  position: relative;
}

.pickup-marker::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #38bdf8;
}

.tesla-marker {
  width: 38px;
  height: 38px;
  background: #0f172a;
  border: 2.5px solid #38bdf8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.65);
}

.hidden {
  display: none !important;
}
