:root {
  --bg: #1d2025;
  --card: #2b2f36;
  --ink: #f2f4f8;
  --muted: #cdd2da;
  --line: #6e7686;
  --cta: #e8ebf2;
  --cta-text: #1f232b;
  --ok: #83d9b0;
  --map-a: #2b313a;
  --map-b: #353d48;
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(178, 187, 202, 0.22) 0%, transparent 36%),
    radial-gradient(circle at 84% 16%, rgba(160, 203, 214, 0.16) 0%, transparent 32%),
    linear-gradient(135deg, #1a1d22 0%, #252a31 100%);
}

.app-shell {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.app-shell::before {
  top: 80px;
  left: -60px;
  background: radial-gradient(circle, rgba(190, 206, 255, 0.09), rgba(190, 206, 255, 0));
  animation: floaty 7s ease-in-out infinite;
}

.app-shell::after {
  top: 380px;
  right: -70px;
  background: radial-gradient(circle, rgba(199, 241, 214, 0.08), rgba(199, 241, 214, 0));
  animation: floaty 8.5s ease-in-out infinite reverse;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.language-select {
  min-width: 132px;
  appearance: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-logo {
  width: 28px;
  height: 28px;
  display: block;
  flex: 0 0 auto;
}

main {
  display: grid;
  gap: 14px;
  position: relative;
}

.card {
  background: var(--card);
  border: 1px solid rgba(223, 230, 240, 0.28);
  border-radius: var(--radius);
  box-shadow: 0 18px 36px rgba(11, 15, 20, 0.45);
  animation: card-in 420ms ease both;
}

.hero-map {
  position: relative;
  height: 230px;
  overflow: hidden;
}

.ride-map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.ride-map .leaflet-tile {
  filter: none;
}

.map-glow {
  position: absolute;
  inset: 20% 26% auto;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(227, 233, 244, 0.22), rgba(227, 233, 244, 0));
  filter: blur(10px);
  z-index: 2;
  pointer-events: none;
}

.trip-chip {
  position: absolute;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(233, 237, 245, 0.97);
  color: #1f252e;
  border-radius: 14px;
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(15, 20, 28, 0.35);
  z-index: 4;
  max-width: min(72%, calc(var(--chip-max-ch, 38) * 1ch));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.trip-chip.visible {
  opacity: 1;
  visibility: visible;
}

.trip-chip .chip-prefix {
  font-weight: 800;
  flex: 0 0 auto;
}

.trip-chip .chip-address {
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pickup {
  text-align: left;
}

.dropoff {
  text-align: left;
}

.driver-car-wrapper {
  background: transparent;
  border: 0;
}

.driver-car-icon {
  width: 36px;
  height: 18px;
  display: block;
  opacity: 1;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 2px 5px rgba(5, 8, 12, 0.65)) contrast(1.06);
}

.driver-info-tooltip {
  background: rgba(17, 23, 29, 0.96);
  color: #ecf2f8;
  border: 1px solid rgba(133, 177, 217, 0.35);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(4, 8, 14, 0.4);
  font-size: 0.72rem;
  line-height: 1.45;
  padding: 8px 10px;
}

.driver-info-tooltip:before {
  border-top-color: rgba(17, 23, 29, 0.96);
}

.hero-map .leaflet-control-zoom {
  margin: 12px;
}

.hero-map .leaflet-control-attribution {
  font-size: 0.62rem;
  background: rgba(39, 44, 53, 0.92);
  color: #dfe4ec;
}

.hero-map .leaflet-control-attribution a {
  color: #f4f7fb;
}

.booking,
.profile,
.safety,
.status {
  padding: 16px;
}

.label {
  margin: 0 0 8px;
  color: #e4e8ef;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.destination-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.destination-search {
  position: relative;
}

.suggestions {
  margin: 6px 0 0;
  padding: 6px;
  list-style: none;
  position: absolute;
  left: 0;
  right: 0;
  background: #2f343c;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(20, 27, 40, 0.12);
  z-index: 7;
  max-height: 210px;
  overflow-y: auto;
  display: none;
}

.suggestions.visible {
  display: block;
}

.suggestions li {
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.9rem;
}

.suggestions li:hover,
.suggestions li.active {
  background: #4a5361;
}

.suggestions .hint {
  cursor: default;
  color: var(--muted);
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  color: #f4f7fc;
  background: #303741;
}

.ride-types {
  display: grid;
  gap: 8px;
  margin: 12px 0 14px;
}

.ride-type {
  font: inherit;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #343b46;
  padding: 12px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.ride-type span {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

.ride-type small {
  color: #e2e6ee;
}

.ride-type:hover {
  transform: translateY(-1px);
}

.ride-type.active {
  background: #495262;
  border-color: #cfd6e2;
}

.ride-type.active span {
  color: #ffffff;
}

.ride-type.active small {
  color: #dfdfdf;
}

.booking-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.booking-grid > * {
  grid-column: 1 / -1;
}

.booking-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
}

.pickup-time-controls {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #343b46;
  padding: 10px;
}

.pickup-time-head {
  display: flex;
  justify-content: flex-start;
}

.time-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #38404d;
  border: 1px solid #808ba0;
  color: #f1f4fa;
  font-size: 0.78rem;
  font-weight: 700;
}

.time-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.time-preset.active {
  background: #dde3ee;
  color: #252b35;
  border-color: #dde3ee;
}

.flatpickr-calendar {
  background: #2a3038;
  border: 1px solid #667083;
  box-shadow: 0 18px 32px rgba(8, 10, 13, 0.62);
}

.flatpickr-calendar .flatpickr-months,
.flatpickr-calendar .flatpickr-weekdays {
  background: #363d48;
}

.flatpickr-calendar .flatpickr-time {
  background: #2f3641;
  border-top: 1px solid #5f6a7f;
}

.flatpickr-calendar .flatpickr-time .flatpickr-time-separator,
.flatpickr-calendar .flatpickr-time .flatpickr-am-pm {
  color: #f5f5f5;
}

.flatpickr-calendar .flatpickr-time input:hover,
.flatpickr-calendar .flatpickr-time input:focus,
.flatpickr-calendar .flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-calendar .flatpickr-time .flatpickr-am-pm:focus {
  background: #414b5a;
  color: #ffffff;
}

.flatpickr-calendar .flatpickr-current-month,
.flatpickr-calendar .flatpickr-weekday,
.flatpickr-calendar .flatpickr-day,
.flatpickr-calendar .flatpickr-time input,
.flatpickr-calendar .numInputWrapper span,
.flatpickr-calendar .flatpickr-am-pm {
  color: #f5f5f5;
}

.flatpickr-calendar .flatpickr-day:hover,
.flatpickr-calendar .flatpickr-day.selected,
.flatpickr-calendar .flatpickr-day.startRange,
.flatpickr-calendar .flatpickr-day.endRange,
.flatpickr-calendar .flatpickr-day.inRange {
  background: #dbe2ef;
  border-color: #dbe2ef;
  color: #1f242d;
}

.price-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #818da3;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price-box h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.profile-status {
  margin: 0 0 10px;
  color: #dbe0e9;
  font-size: 0.9rem;
}

.profile-hint {
  margin: 0 0 10px;
  color: #b7c0cf;
  font-size: 0.82rem;
}

.auth-switch {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 4px;
}

.auth-switch .ghost-btn.active {
  background: #dde3ee;
  color: #252b35;
  border-color: #dde3ee;
}

.profile-status[data-tone="success"] {
  color: #b7f0cd;
}

.profile-status[data-tone="error"] {
  color: #ffc4c4;
}

.profile-form {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.profile-form[hidden] {
  display: none;
}

.profile-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.86rem;
}

.profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c8d3e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.password-toggle svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  display: block;
  flex: 0 0 auto;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(207, 216, 232, 0.14);
  color: #f3f7ff;
  transform: translateY(-50%);
}

.password-toggle.is-visible {
  color: #f3f7ff;
}

.password-strength {
  font-size: 0.78rem;
  color: #bcc7d8;
}

.password-strength.weak {
  color: #ffb6b6;
}

.password-strength.medium {
  color: #ffe4a7;
}

.password-strength.strong {
  color: #bbefc9;
}

.password-requirements {
  margin: 0;
  padding-left: 16px;
  color: #b8c2d2;
  font-size: 0.74rem;
  display: grid;
  gap: 2px;
}

.password-requirements li {
  opacity: 0.7;
}

.password-requirements li.ok {
  color: #c1f3d1;
  opacity: 1;
}

.profile-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-modal {
  position: fixed;
  inset: 0;
  transform: none;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  overflow: auto;
  z-index: 25;
  border-radius: 0;
  padding: clamp(10px, 2vw, 20px);
  animation: none;
}

.profile-modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 18, 0.32);
  z-index: 24;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop[hidden] {
  display: none;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-head h3,
.status h3 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  height: 37px;
  padding: 0 10px;
  background: #325444;
  color: #c4f5dd;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.safety-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.safety-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #343b46;
}

.safety-grid h4 {
  margin: 0 0 6px;
}

.safety-grid p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.safety-grid strong {
  font-family: "Space Grotesk", sans-serif;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.step {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #3a424f;
  text-align: center;
  padding: 9px 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.step.done {
  background: #355847;
  border-color: #7dc79d;
}

.booking-confirm-modal {
  position: fixed;
  inset: 0;
  transform: none;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  overflow: auto;
  z-index: 75;
  border-radius: 0;
  padding: clamp(10px, 2vw, 20px);
  animation: none;
}

.booking-confirm-modal[hidden] {
  display: none;
}

.booking-confirm-head {
  margin-bottom: 8px;
}

.booking-confirm-text {
  margin: 0 0 14px;
  color: #dbe0e9;
}

.booking-confirm-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.booking-confirm-summary > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #343b46;
}

.booking-confirm-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.booking-confirm-summary strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.98rem;
}

.booking-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.cta,
.ghost-btn {
  font: inherit;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: transform 140ms ease, opacity 140ms ease;
}

.cta {
  background: linear-gradient(145deg, #edf1f8, #d3d9e6);
  color: var(--cta-text);
  padding: 12px 16px;
  font-weight: 700;
}

.ghost-btn {
  background: #353b46;
  border: 1px solid #798396;
  padding: 10px 12px;
  color: #edf0f6;
  font-weight: 700;
}

.ghost-btn.small {
  padding: 9px 10px;
  font-size: 0.8rem;
}

.cta:hover,
.ghost-btn:hover {
  transform: translateY(-1px) scale(1.01);
}

.password-toggle.ghost-btn.small,
.password-toggle.ghost-btn {
  padding: 0;
  border: 0;
  border-radius: 8px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  transform: translateY(-50%);
  transition: background 140ms ease, color 140ms ease;
}

.password-toggle.ghost-btn:hover,
.password-toggle.ghost-btn:focus-visible,
.password-toggle.ghost-btn.small:hover,
.password-toggle.ghost-btn.small:focus-visible {
  transform: translateY(-50%);
}

main > .card:nth-child(2) {
  animation-delay: 80ms;
}

main > .card:nth-child(3) {
  animation-delay: 140ms;
}

main > .card:nth-child(4) {
  animation-delay: 200ms;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes chip-pop {
  0% {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  .booking-grid,
  .safety-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .price-box {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-modal,
  .booking-confirm-modal {
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    transform: none;
    border-radius: 0;
    padding: 12px;
  }

  .profile-modal .section-head,
  .booking-confirm-modal .section-head {
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }

  .profile-head-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }

  .profile-head-actions .ghost-btn.small {
    padding: 8px 10px;
  }

}

@media (max-width: 420px) {
  .profile-modal,
  .booking-confirm-modal {
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    transform: none;
    border-radius: 0;
    padding: 10px;
  }
}

