:root {
  color-scheme: dark;
  --bg: #070b20;
  --panel: rgba(13, 20, 48, .92);
  --panel-2: rgba(255, 255, 255, .08);
  --text: #f8fbff;
  --muted: #a9b3c7;
  --line: rgba(255, 255, 255, .12);
  --pink: #ff2da1;
  --purple: #7c3cff;
  --cyan: #22e6df;
  --green: #22c55e;
  --danger: #fb7185;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(124, 60, 255, .22), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(255, 45, 161, .18), transparent 32%),
    linear-gradient(180deg, #050817, #090d27 48%, #050817);
  color: var(--text);
}

button, input, select, textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(11, 18, 48, .94), rgba(5, 8, 23, .98));
  box-shadow: 0 0 80px rgba(0, 0, 0, .35);
}

.screen {
  min-height: 100vh;
  padding: calc(env(safe-area-inset-top) + 22px) 18px calc(env(safe-area-inset-bottom) + 92px);
}

.boot-screen {
  display: grid;
  place-content: center;
  text-align: center;
}

.boot-logo {
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
}

.auth-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  gap: 18px;
  width: min(100%, 560px);
  margin: 0 auto;
}

.auth-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(3, 7, 22, .92) 0%, rgba(4, 8, 26, .84) 42%, rgba(8, 8, 29, .78) 100%),
    radial-gradient(circle at 78% 16%, rgba(255, 45, 161, .22), transparent 34%),
    radial-gradient(circle at 22% 78%, rgba(34, 230, 223, .18), transparent 34%),
    url("/passenger-web/assets/auth-city-bg.png") center / cover no-repeat;
}

.auth-screen::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 7, 22, .08), rgba(4, 7, 22, .42)),
    radial-gradient(circle at 50% 46%, transparent 0 28%, rgba(3, 6, 18, .38) 74%);
}

.mobile-gate {
  width: min(100%, 640px);
}

.device-card h1 {
  max-width: 9ch;
}

.device-actions {
  text-align: center;
}

.device-actions strong,
.device-actions small {
  display: block;
}

.device-icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 26px;
  font-size: 38px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.48), transparent 28%),
    linear-gradient(135deg, rgba(34,230,223,.78), rgba(255,45,161,.84));
  box-shadow: 0 22px 60px rgba(255, 45, 161, .22);
}

.device-link {
  display: grid;
  place-items: center;
  min-height: 54px;
  margin: 18px 0 12px;
  color: #fff;
  text-decoration: none;
}

.auth-hero {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(124, 60, 255, .38), rgba(255, 45, 161, .20)),
    radial-gradient(circle at 80% 0%, rgba(34, 230, 223, .22), transparent 34%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
  backdrop-filter: blur(16px);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  font-weight: 950;
  font-size: 24px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 18px 50px rgba(255, 45, 161, .24);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  padding: 6px;
  background: rgba(255,255,255,.92);
}

.auth-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 19px;
}

.eyebrow {
  margin: 22px 0 8px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 900;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-hero p:last-child,
.muted {
  color: var(--muted);
}

.auth-card,
.panel,
.sheet,
.card,
.ride-option,
.basic-tile {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.auth-card {
  border-radius: 28px;
  padding: 14px;
  box-shadow: 0 26px 80px rgba(255, 45, 161, .14), 0 18px 70px rgba(0, 0, 0, .30);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
  margin-bottom: 14px;
}

.segmented button {
  border: 0;
  border-radius: 14px;
  padding: 13px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.segmented button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--pink));
}

.form-grid {
  display: grid;
  gap: 12px;
}

.otp-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(34, 230, 223, .24);
  border-radius: 18px;
  background: rgba(34, 230, 223, .07);
}

.otp-box small {
  color: var(--muted);
  line-height: 1.35;
}

.otp-row {
  display: grid;
  grid-template-columns: 1fr 128px;
  gap: 10px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: #dbe5ff;
  font-size: 13px;
  font-weight: 850;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  padding: 15px 16px;
  color: #fff;
  background: rgba(4, 9, 28, .88);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(34, 230, 223, .75);
  box-shadow: 0 0 0 4px rgba(34, 230, 223, .12);
}

.primary,
.secondary,
.ghost,
.danger {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  padding: 14px 18px;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.primary {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 18px 42px rgba(255, 45, 161, .22);
}

.secondary {
  background: linear-gradient(135deg, #0ea5e9, var(--cyan));
  color: #061223;
}

.ghost {
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
}

.danger {
  background: rgba(251, 113, 133, .14);
  border: 1px solid rgba(251, 113, 133, .34);
  color: #fecdd3;
}

.hidden { display: none !important; }

.firebase-recaptcha {
  position: fixed;
  left: -9999px;
  bottom: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 950;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  overflow: hidden;
}

.profile-chip strong,
.profile-chip span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-chip span {
  color: var(--muted);
  font-size: 12px;
}

.map-wrap {
  position: relative;
  height: 300px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  background:
    linear-gradient(rgba(6, 13, 34, .2), rgba(6, 13, 34, .72)),
    repeating-linear-gradient(30deg, rgba(255,255,255,.06) 0 1px, transparent 1px 42px),
    linear-gradient(135deg, rgba(34, 230, 223, .18), rgba(124, 60, 255, .18));
}

#map {
  height: 100%;
  width: 100%;
}

.map-overlay {
  position: absolute;
  inset: auto 14px 14px;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.search-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .94);
  color: #0b1025;
  box-shadow: 0 18px 50px rgba(0,0,0,.20);
  pointer-events: auto;
}

.address-control {
  align-items: flex-start;
}

.suggestions {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% + 6px);
  z-index: 9999;
  display: grid;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(0,0,0,.26);
}

.suggestions.basic {
  position: static;
  margin-top: 6px;
}

.suggestions:empty {
  display: none;
}

.suggestions button {
  border: 0;
  padding: 12px 14px;
  color: #0b1025;
  background: #fff;
  text-align: left;
  font-size: 13px;
  font-weight: 750;
}

.suggestions button + button {
  border-top: 1px solid rgba(15,23,42,.08);
}

.search-pill input {
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  color: #0b1025;
  background: transparent;
  box-shadow: none;
}

.sheet {
  margin-top: -22px;
  position: relative;
  z-index: 2;
  border-radius: 28px 28px 0 0;
  padding: 18px 16px 96px;
}

.flow-panel {
  margin-top: 16px;
  position: static;
  border-radius: 26px;
  padding: 18px;
  z-index: 1;
}

.handle {
  width: 56px;
  height: 5px;
  border-radius: 999px;
  margin: 0 auto 18px;
  background: rgba(255,255,255,.28);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 18px;
  margin-bottom: 0;
}

.link-button {
  border: 0;
  background: transparent;
  color: #d36bff;
  font-weight: 900;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.service-card {
  min-height: 136px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  text-align: left;
}

.service-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  margin-bottom: 12px;
  font-size: 42px;
  line-height: 1;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.52), transparent 24%), linear-gradient(135deg, var(--purple), var(--pink));
}

.service-card strong,
.service-card span {
  display: block;
}

.service-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.full { grid-column: 1 / -1; }

.ride-option {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border-radius: 22px;
  padding: 12px;
  margin-bottom: 10px;
  color: #fff;
  text-align: left;
}

.ride-option.active {
  border-color: rgba(255, 45, 161, .88);
  box-shadow: 0 0 0 4px rgba(255, 45, 161, .13);
}

.car {
  width: 58px;
  height: 46px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: rgba(255,255,255,.09);
}

.price {
  color: #fff;
  font-weight: 950;
  font-size: 18px;
}

.summary {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.summary-row {
  display: flex;
  gap: 10px;
  padding: 13px;
  border-radius: 16px;
  background: rgba(255,255,255,.07);
}

.summary-row span:first-child {
  color: var(--cyan);
  font-weight: 950;
}

.passenger-count-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid rgba(34, 230, 223, .25);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(34, 230, 223, .13), rgba(255, 45, 161, .10)),
    rgba(255, 255, 255, .06);
}

.passenger-count-card span,
.passenger-count-card strong,
.passenger-count-card small {
  display: block;
}

.passenger-count-card span {
  color: var(--cyan);
  font-weight: 950;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.passenger-count-card strong {
  margin-top: 4px;
  font-size: 18px;
}

.passenger-count-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.passenger-price-breakdown {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(34, 230, 223, .22);
  border-radius: 14px;
  background: rgba(0, 0, 0, .18);
}

.passenger-price-breakdown div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.passenger-price-breakdown span,
.passenger-price-breakdown strong {
  margin: 0;
  letter-spacing: 0;
  text-transform: none;
}

.passenger-price-breakdown span {
  color: var(--muted);
  font-size: 12px;
}

.passenger-price-breakdown strong {
  color: var(--white);
  font-size: 13px;
  text-align: right;
}

.passenger-price-total {
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, .10);
}

.passenger-price-total span,
.passenger-price-total strong {
  color: var(--cyan);
  font-weight: 950;
}

.stepper {
  display: grid;
  grid-template-columns: 42px 42px 42px;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(0, 0, 0, .22);
}

.stepper button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  background: linear-gradient(135deg, var(--purple), var(--pink));
}

.stepper button:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.stepper output {
  text-align: center;
  font-weight: 950;
  font-size: 18px;
}

.basic-home h1 {
  font-size: 42px;
  margin: 20px 0 18px;
}

.basic-map {
  height: 152px;
  margin-bottom: 22px;
}

.basic-actions {
  display: grid;
  gap: 14px;
}

.basic-actions .primary,
.basic-actions .secondary,
.basic-actions .ghost {
  min-height: 78px;
  font-size: 24px;
  border-radius: 24px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 4px;
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px);
  background: rgba(6, 10, 28, .88);
  border-top: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  border: 0;
  border-radius: 18px;
  min-height: 58px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  font-size: 12px;
}

.bottom-nav button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124,60,255,.38), rgba(255,45,161,.32));
}

.ride-layout,
.basic-layout {
  display: grid;
  gap: 18px;
}

.route-panel,
.map-panel,
.basic-panel,
.route-card {
  min-width: 0;
}

.route-card,
.map-panel,
.basic-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: 28px;
}

.route-card,
.basic-panel {
  padding: 18px;
}

.address-stack {
  display: grid;
  gap: 14px;
}

.route-card h1,
.basic-panel h1 {
  margin-bottom: 18px;
}

.map-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.map-toolbar strong,
.map-toolbar span {
  display: block;
}

.map-toolbar span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.compact {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  white-space: nowrap;
}

.address-summary label {
  color: #dbe5ff;
}

.address-summary input {
  margin-top: 7px;
}

.route-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ride-screen .flow-panel {
  overflow: auto;
}

.list {
  display: grid;
  gap: 12px;
}

.card {
  border-radius: 22px;
  padding: 16px;
}

.panel-screen {
  max-width: 1180px;
  margin: 0 auto;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.trip-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
}

.trip-card small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.35;
}

.wallet-grid,
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.account-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.compact-card {
  display: grid;
  gap: 4px;
}

.empty-state {
  text-align: center;
  padding: 28px;
}

.profile-photo-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
}

.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);
}

.qr-image {
  width: 180px;
  max-width: 100%;
  border-radius: 18px;
  padding: 10px;
  background: #fff;
  margin: 12px 0;
}

.wallet-payment textarea {
  min-height: 96px;
  resize: vertical;
}

.register-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 20;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 28px));
  border-radius: 18px;
  padding: 14px 16px;
  color: #071022;
  background: #fff;
  font-weight: 900;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}

@media (max-width: 380px) {
  .screen { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 30px; }
  .services-grid { grid-template-columns: 1fr; }
  .basic-actions .primary,
  .basic-actions .secondary,
  .basic-actions .ghost { font-size: 20px; }
  .otp-row { grid-template-columns: 1fr; }
}

@media (min-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .screen:not(.auth-screen) {
    min-height: 100vh;
    padding: 24px 28px 24px 304px;
  }

  .topbar {
    max-width: 1480px;
    margin: 0 auto 18px;
  }

  .ride-layout {
    grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
    height: calc(100vh - 110px);
    max-width: 1480px;
    margin: 0 auto;
  }

  .basic-layout {
    grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
    min-height: calc(100vh - 110px);
    max-width: 1480px;
    margin: 0 auto;
  }

  .route-panel,
  .map-panel {
    height: 100%;
  }

  .route-panel {
    overflow: visible;
  }

  .route-card {
    position: relative;
    z-index: 6;
  }

  .ride-screen .flow-panel {
    flex: 1;
    padding-bottom: 18px;
    position: relative;
    z-index: 1;
  }

  .map-wrap {
    height: 100%;
    min-height: 420px;
    border: 0;
    border-radius: 0;
  }

  .basic-map {
    height: 100%;
    min-height: 520px;
    margin-bottom: 0;
  }

  .basic-panel {
    align-self: stretch;
    display: grid;
    align-content: center;
    padding: 34px;
  }

  .basic-actions .primary,
  .basic-actions .secondary,
  .basic-actions .ghost {
    min-height: 68px;
    font-size: 21px;
  }

  .bottom-nav {
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    transform: none;
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    align-content: start;
    gap: 10px;
    padding: 28px 20px;
    border-top: 0;
    border-right: 1px solid rgba(255,255,255,.12);
    background:
      radial-gradient(circle at 0% 0%, rgba(124,60,255,.30), transparent 36%),
      rgba(6, 10, 28, .94);
  }

  .bottom-nav::before {
    content: "Passageiro Web";
    display: block;
    margin: 4px 0 20px;
    color: #fff;
    font-size: 22px;
    font-weight: 950;
  }

  .bottom-nav button {
    min-height: 62px;
    padding: 12px 14px;
    border-radius: 18px;
    text-align: left;
    font-size: 16px;
    background: rgba(255,255,255,.06);
  }

  .bottom-nav button.active {
    box-shadow: 0 18px 42px rgba(255,45,161,.18);
  }

  .toast {
    left: auto;
    right: 28px;
    bottom: 28px;
    transform: none;
  }
}

@media (max-width: 899px) {
  .app-shell {
    max-width: 520px;
  }

  .route-card {
    margin-bottom: 0;
  }

  .map-panel {
    border-radius: 28px;
  }

  .map-toolbar {
    display: none;
  }

  .flow-panel {
    margin-top: 14px;
    padding-bottom: 96px;
  }

  .wallet-grid,
  .account-grid,
  .register-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    display: grid;
  }

  .profile-photo-row {
    grid-template-columns: 76px 1fr;
  }

  .profile-photo {
    width: 76px;
    height: 76px;
    border-radius: 22px;
  }

  .ride-layout,
  .basic-layout {
    gap: 14px;
  }

  .ride-screen .map-panel {
    order: 1;
  }

  .ride-screen .route-panel {
    order: 2;
  }
}
