/* ============================================================
   FURGOFY v2 — Design System
   Paleta: nocturno + dorado + lima eléctrico
   ============================================================ */

:root {
  /* Brand tokens */
  --night-1: #0b0d0f;
  --night-2: #101214;
  --night-3: #181b1f;
  --night-4: #242830;
  --gold:    #c9a44c;
  --gold-2:  #e3c071;
  --gold-3:  #f4dc99;
  --lime:    #a8e010;
  --lime-2:  #c0f23a;
  --ivory:   #f4edda;
  --ivory-2: #d9d3c1;
  --muted:   #8a8d92;
  --danger:  #ff6464;
  --success: #6dd66d;

  /* Type — DM Serif Display (alta presencia, formas limpias) + Inter (UI) */
  --font-display: 'DM Serif Display', 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Geometry */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* Layout */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Easing */
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--night-1); }
body {
  font-family: var(--font-ui);
  color: var(--ivory);
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(201,164,76,.10), transparent 60%),
    radial-gradient(120% 80% at 50% 110%, rgba(168,224,16,.06), transparent 60%),
    var(--night-1);
}

button { font-family: inherit; }

/* Subtle motion blur background (like the dossier) */
.bg-motion::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 7px),
    radial-gradient(80% 40% at 80% 20%, rgba(201,164,76,.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   App shell
   ============================================================ */

#app {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--safe-bottom) + 90px);
  overflow-x: hidden;
}

/* Landing pública: sin tabbar/rail, sin padding reservado al shell */
body[data-screen="welcome"] .tabbar { display: none !important; }
body[data-screen="welcome"] #app    { padding-bottom: calc(var(--safe-bottom) + 24px); }

.screen {
  display: none;
  animation: fadeUp .28s var(--ease);
}
.screen.active { display: block; }

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

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 8px;
}
.topbar .ico-btn {
  width: 40px; height: 40px;
  background: var(--night-3);
  border: 1px solid #2a2f36;
  border-radius: 999px;
  display: grid; place-items: center;
  color: var(--ivory);
  cursor: pointer;
}
.topbar .title {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: .3px;
  color: var(--gold-2);
  font-weight: 600;
  flex: 1;
}

/* Brand */
.brand-row {
  display: inline-flex; align-items: center;
  text-decoration: none;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.35));
}
.brand-logo {
  height: 44px;
  width: auto;
  display: block;
}

/* Logo grande en hero del welcome */
.hero-logo {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: -8px 0 6px;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,.45)) drop-shadow(0 0 18px rgba(168,224,16,.10));
}

/* Logo en el cierre */
.foot-logo {
  display: block;
  height: 56px;
  width: auto;
  margin: 0 auto 14px;
  opacity: .95;
}

/* Hero */
.hero {
  padding: 36px 22px 22px;
  text-align: center;
}
.hero .kicker {
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--lime);
  font-weight: 600;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin: 12px 0 10px;
  color: var(--ivory);
  font-weight: 500;
}
.hero h1 em {
  color: var(--gold-2);
  font-style: italic;
}
.hero p {
  color: var(--ivory-2);
  max-width: 36ch;
  margin: 0 auto;
}

.hero-visual {
  position: relative;
  margin: 28px auto 8px;
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(160deg, #1a1d22, #0b0d0f 80%);
  border: 1px solid #21262d;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6), 0 0 0 1px rgba(201,164,76,.06);
}
.hero-visual::after {
  /* lights blur */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(20% 30% at 18% 70%, rgba(255,210,120,.35), transparent 70%),
    radial-gradient(15% 25% at 78% 60%, rgba(168,224,16,.20), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 6px);
  pointer-events: none;
}
.hero-visual svg.van {
  position: absolute;
  width: 80%;
  bottom: 8%;
  left: 10%;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,.5));
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 54px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  border: 0;
  cursor: pointer;
  transition: transform .12s var(--ease), filter .12s var(--ease);
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--lime);
  color: #0a0c00;
  box-shadow: 0 10px 22px -8px rgba(168,224,16,.55);
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1b1305;
  box-shadow: 0 10px 22px -10px rgba(201,164,76,.6);
}

.btn-ghost {
  background: transparent;
  color: var(--ivory);
  border: 1px solid #2a2f36;
}
.btn-ghost:hover { background: var(--night-3); }

.btn-block { width: 100%; }

/* ============================================================
   Cards / Lists
   ============================================================ */
.card {
  background: linear-gradient(180deg, #15181d, #11141a);
  border: 1px solid #20252c;
  border-radius: var(--r-lg);
  padding: 18px;
}
.card-soft {
  background: #14171c;
  border: 1px solid #1f242b;
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.card-row {
  display: flex; align-items: center; gap: 12px;
}
.card-row + .card-row { margin-top: 12px; }

.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold-2);
  margin: 22px 22px 12px;
  letter-spacing: .3px;
}

.list {
  padding: 0 16px;
  display: flex; flex-direction: column; gap: 10px;
}

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: #14171c;
  border: 1px solid #1f242b;
  border-radius: var(--r-md);
}
.row .ic {
  width: 38px; height: 38px;
  background: rgba(168,224,16,.10);
  color: var(--lime);
  border-radius: 12px;
  display: grid; place-items: center;
  flex: 0 0 38px;
}
.row .meta { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.row .price { margin-left: auto; color: var(--gold-2); font-weight: 600; }

/* ============================================================
   Forms
   ============================================================ */
.field { padding: 0 22px; margin-bottom: 14px; }
.label {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--gold-2);
  font-weight: 700;
  margin-bottom: 7px;
  display: block;
}
.input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #191d24;
  border: 1.5px solid rgba(244,237,218,.30);
  border-radius: var(--r-md);
  padding: 4px 14px;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.input-wrap:focus-within {
  border-color: var(--gold-2);
  background: #1c2027;
}
.input-wrap .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(168,224,16,.15);
}
.input-wrap .dot.dest { background: var(--gold); box-shadow: 0 0 0 4px rgba(201,164,76,.18); }
.input-wrap input {
  border: 0; background: transparent; outline: none;
  color: var(--ivory);
  font-size: 16px;
  padding: 14px 0;
  width: 100%;
}
.input-wrap input::placeholder { color: #838a92; }
.link-forgot { background:none; border:none; color:var(--gold-2); font-size:13.5px; cursor:pointer; font-family:inherit; text-decoration:underline; padding:4px; }
.link-forgot:hover { color:var(--gold-3); }
/* Aceptación de condiciones en el registro */
.reg-terms { display:flex; align-items:flex-start; gap:10px; padding:2px 22px 10px; font-size:13.5px; line-height:1.4; color:var(--ivory-2); cursor:pointer; }
.reg-terms input { margin-top:2px; width:18px; height:18px; accent-color:var(--lime); flex:0 0 auto; }
.reg-terms a { color:var(--gold-2); text-decoration:underline; }
.reg-terms a:hover { color:var(--gold-3); }
/* Chip de sesión en la cabecera de home */
.session-chip { margin-left:auto; display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-family:inherit;
  font-size:13.5px; font-weight:600; border-radius:999px; border:1px solid rgba(244,237,218,.16); background:var(--night-3); color:var(--ivory); }
.session-chip.out { padding:8px 16px; color:var(--gold-2); border-color:rgba(201,164,76,.4); }
.session-chip.out:hover { color:var(--gold-3); border-color:var(--gold-2); }
.session-chip.in { padding:4px 12px 4px 4px; }
.session-chip .sc-avatar { width:26px; height:26px; border-radius:50%; display:grid; place-items:center;
  background:linear-gradient(120deg,var(--gold),var(--gold-2)); color:#1a1405; font-size:11px; font-weight:700; }
.session-chip .sc-name { max-width:110px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Más contraste en los inputs de las pantallas de cuenta (login/registro/
   recuperar), que sobre ese fondo se veían apagados. */
[data-screen="auth"] .input-wrap,
[data-screen="reset"] .input-wrap {
  background: #232936;
  border-color: rgba(244,237,218,.5);
}
[data-screen="auth"] .input-wrap input,
[data-screen="reset"] .input-wrap input { color: var(--ivory); }
[data-screen="auth"] .input-wrap input::placeholder,
[data-screen="reset"] .input-wrap input::placeholder { color: #9aa1ab; }

.suggestions {
  margin-top: 8px;
  background: #11141a;
  border: 1px solid #1f242b;
  border-radius: var(--r-md);
  overflow: hidden;
}
.suggestions button {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: transparent;
  color: var(--ivory);
  border: 0;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid #181c22;
  font-size: 14px;
}
.suggestions button:last-child { border-bottom: 0; }
.suggestions button:hover { background: #161a20; }
.suggestions button .pin { color: var(--gold-2); }
.suggestions button .sub { color: var(--muted); font-size: 12.5px; display: block; }

/* Vehicle selector */
.vehicle-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 22px;
}
.veh {
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: var(--r-md);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s var(--ease), transform .12s var(--ease);
}
.veh:hover { transform: translateY(-1px); }
.veh.sel {
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(168,224,16,.35);
  background: linear-gradient(180deg, rgba(168,224,16,.08), #ffffff);
}
.veh svg { width: 64px; height: 40px; color: #0b0d0f; }
.veh .name { display: block; margin-top: 8px; font-weight: 700; font-size: 14px; color: #0b0d0f; }
.veh .vol  { display: inline-block; margin-top: 6px; color: #3f6d00; font-size: 12px;
  border: 1px solid rgba(168,224,16,.55); background: rgba(168,224,16,.14); border-radius: 999px; padding: 2px 9px; }

/* Slider */
.slider-row { padding: 16px 22px; }
.slider {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}
.slider::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--lime) 0 var(--p,30%), #1f242b var(--p,30%) 100%);
  border-radius: 999px;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  margin-top: -8px;
  height: 22px; width: 22px;
  background: var(--ivory);
  border: 4px solid var(--lime);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 12px -3px rgba(0,0,0,.6);
}
.slider::-moz-range-track {
  height: 6px;
  background: #1f242b;
  border-radius: 999px;
}
.slider::-moz-range-thumb {
  height: 22px; width: 22px;
  background: var(--ivory);
  border: 4px solid var(--lime);
  border-radius: 999px;
  cursor: pointer;
}

/* Tarifa breakdown */
.fare-card {
  margin: 8px 22px 0;
  background:
    radial-gradient(120% 50% at 0% 0%, rgba(201,164,76,.10), transparent 60%),
    linear-gradient(180deg, #15181d, #11141a);
  border: 1px solid #2a2f36;
  border-radius: var(--r-lg);
  padding: 22px;
}
.fare-total {
  font-family: var(--font-display);
  font-size: 44px;
  color: var(--gold-2);
  letter-spacing: -1px;
}
.fare-breakdown {
  margin-top: 16px;
  display: grid; gap: 6px;
}
.fare-breakdown .b { display: flex; justify-content: space-between; color: var(--ivory-2); font-size: 14px; }
.fare-breakdown .b strong { color: var(--ivory); font-weight: 600; }
.demand-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(168,224,16,.10);
  color: var(--lime);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(168,224,16,.25);
}

/* ============================================================
   Search animation (matching driver)
   ============================================================ */
.search-stage {
  position: relative;
  margin: 28px auto 16px;
  width: 240px; height: 240px;
}
.search-stage .pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid var(--lime);
  opacity: 0;
  animation: pulse 2.2s var(--ease) infinite;
}
.search-stage .pulse:nth-child(2) { animation-delay: .7s; }
.search-stage .pulse:nth-child(3) { animation-delay: 1.4s; }
@keyframes pulse {
  0% { transform: scale(.35); opacity: .9; }
  100% { transform: scale(1.1); opacity: 0; }
}
.search-stage .center {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}

/* ============================================================
   Tracking map
   ============================================================ */
#map {
  height: 60vh;
  width: 100%;
  border-radius: 0;
  background: var(--night-3);
}
.leaflet-container { background: var(--night-3); }

.driver-card {
  margin: -34px 14px 0;
  position: relative; z-index: 600;
  background: linear-gradient(180deg, #15181d, #0e1115);
  border: 1px solid #262b33;
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 -10px 30px -10px rgba(0,0,0,.6);
}
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  display: grid; place-items: center;
  color: #1c1305;
  font-weight: 700;
  font-size: 19px;
  border: 2px solid #1a1d22;
}
.driver-card .name { font-weight: 600; font-size: 16px; }
.driver-card .car  { color: var(--muted); font-size: 13px; margin-top: 2px; }
.rate { color: var(--gold-2); font-size: 12.5px; }

.call-buttons { display: flex; gap: 8px; margin-left: auto; }
.call-buttons button {
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid #2a2f36;
  background: #181b21;
  color: var(--lime);
  cursor: pointer;
  display: grid; place-items: center;
}

.phases {
  margin: 14px;
  background: linear-gradient(180deg, #15181d, #11141a);
  border: 1px solid #20252c;
  border-radius: var(--r-lg);
  padding: 16px 18px;
}
.phase-line {
  position: relative;
  padding-left: 30px;
  padding-bottom: 14px;
  border-left: 1.5px dashed #2a2f36;
  margin-left: 6px;
}
.phase-line:last-child { border-left: 1.5px dashed transparent; padding-bottom: 0; }
.phase-line .dot {
  position: absolute; left: -8px; top: 1px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--night-2);
  border: 2px solid #2a2f36;
}
.phase-line.done .dot { background: var(--lime); border-color: var(--lime); }
.phase-line.now .dot {
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 0 5px rgba(168,224,16,.15);
}
.phase-line .lbl { font-weight: 600; font-size: 14.5px; }
.phase-line .lbl.muted { color: var(--muted); font-weight: 500; }
.phase-line .sub { color: var(--muted); font-size: 12.5px; }

/* ============================================================
   Bottom tab bar
   ============================================================ */
.tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  padding: 8px 16px calc(8px + var(--safe-bottom));
  background:
    linear-gradient(180deg, rgba(11,13,15,0) 0%, rgba(11,13,15,.85) 30%, rgba(11,13,15,.97) 100%);
  backdrop-filter: blur(12px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  z-index: 800;
}

/* .rail-brand sólo se ve en desktop (dentro del rail vertical) */
.rail-brand { display: none; }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px 0 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--gold-2); }
.tab.active svg { color: var(--gold-2); }

/* ============================================================
   Misc
   ============================================================ */
.spacer-lg { height: 22px; }
.flex { display: flex; }
.between { justify-content: space-between; align-items: center; }
.actions { padding: 12px 22px 22px; }
.actions .btn + .btn { margin-top: 10px; }

.eyebrow {
  font-size: 11px; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--lime); font-weight: 600;
}
.muted { color: var(--muted); }
.eta-big {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold-2);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%; bottom: 110px;
  transform: translate(-50%, 30px);
  background: #1b1f25;
  color: var(--ivory);
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid #2a2f36;
  opacity: 0;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  z-index: 1000;
  font-size: 14px;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Overlay: porte finalizado */
.done-overlay {
  position: fixed; inset: 0; z-index: 1200;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(7,9,11,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: doneFade .25s ease;
}
.done-overlay[hidden] { display: none; }
.done-card {
  width: 100%; max-width: 360px;
  background: var(--night-2);
  border: 1px solid #2a2f36;
  border-radius: 22px;
  padding: 30px 26px 26px;
  text-align: center;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.7);
  animation: donePop .32s cubic-bezier(.2,.8,.25,1);
}
.done-check {
  width: 66px; height: 66px; margin: 0 auto 16px;
  border-radius: 999px;
  display: grid; place-items: center;
  color: #0a0c00; background: var(--lime);
  box-shadow: 0 10px 26px -8px rgba(168,224,16,.6);
}
.done-title {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 500;
  color: var(--ivory); margin: 0 0 8px;
}
.done-msg {
  color: var(--ivory-2);
  font-size: 15px; line-height: 1.5;
  margin: 0 auto 8px; max-width: 30ch;
}
.done-amount {
  color: var(--gold-2);
  font-size: 14px; font-weight: 600;
  margin: 0 0 20px;
}
.done-amount[hidden] { display: none; }
.done-card .btn { width: 100%; height: 52px; margin-top: 6px; }
@keyframes doneFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes donePop { from { opacity: 0; transform: translateY(14px) scale(.96) } to { opacity: 1; transform: none } }

/* Modal de condiciones (primera vez que se pide un porte) */
.info-card { text-align: center; max-width: 380px; }
.info-badge { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1a1405; box-shadow: 0 10px 26px -8px rgba(201,164,76,.55); }
.info-list { list-style: none; margin: 6px 0 22px; padding: 0; display: grid; gap: 13px; text-align: left; }
.info-list li { color: var(--ivory-2); font-size: 14.5px; line-height: 1.5; padding-left: 20px; position: relative; }
.info-list li::before { content: ''; position: absolute; left: 3px; top: 8px; width: 7px; height: 7px; border-radius: 999px; background: var(--lime); }
.info-list b { color: var(--ivory); font-weight: 600; }

/* Install prompt */
.install-banner {
  position: fixed;
  left: 50%; bottom: 18px; top: auto;
  transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 10px;
  background: var(--night-3);
  border: 1px solid #2a2f36;
  color: var(--ivory);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 900;
}
.install-banner.on { opacity: 1; transform: translate(-50%, 0); }
.install-banner button {
  background: var(--lime);
  color: #0a0c00;
  border: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}
.install-banner .close {
  background: transparent; color: var(--muted); border: 0; cursor: pointer; font-size: 18px;
}

/* iOS install hint */
.ios-hint {
  position: fixed; left: 14px; right: 14px; bottom: 100px;
  background: var(--night-3);
  border: 1px solid #2a2f36;
  border-radius: var(--r-md);
  padding: 14px;
  z-index: 900;
  display: none;
}
.ios-hint.on { display: block; }
.ios-hint b { color: var(--gold-2); }

/* Sticky bottom action area (for screens with primary CTA) */
.sticky-cta {
  position: sticky;
  bottom: 0;
  padding: 14px 22px calc(14px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, var(--night-1) 30%);
}

/* Map adjustments */
.leaflet-control-attribution { background: rgba(11,13,15,.7) !important; color: #777 !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--gold-2) !important; }

/* Driver van marker */
.driver-marker {
  width: 36px; height: 36px;
  background: var(--night-2);
  border: 2px solid var(--lime);
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 0 0 6px rgba(168,224,16,.15);
}
.driver-marker svg { width: 22px; height: 22px; color: var(--lime); }

.pin-marker {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--lime);
  border: 3px solid var(--night-2);
  box-shadow: 0 0 0 4px rgba(168,224,16,.18);
}
.pin-marker.dest { background: var(--gold); box-shadow: 0 0 0 4px rgba(201,164,76,.18); }

/* ============================================================
   NEW WELCOME (landing para usuario nuevo)
   ============================================================ */

.hero-new {
  padding: 4px 22px 8px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.06;
  letter-spacing: -0.4px;
  margin: 8px 0 10px;
  color: var(--ivory);
  font-weight: 500;
}
.hero-copy h1 em {
  color: var(--gold-2);
  font-style: italic;
}
.hero-sub {
  color: var(--ivory-2);
  font-size: 15px;
  max-width: 46ch;
  margin: 0 0 18px;
}

.hero-ctas {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.hero-ctas .btn { height: 50px; padding: 0 18px; }

.trust-row {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  gap: 6px 16px;
}
.trust-row li {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ivory-2);
  font-size: 12.5px;
}
.trust-row li svg { color: var(--lime); flex: 0 0 14px; }

.hero-fleet {
  position: relative;
  border-radius: var(--r-lg);
  padding: 4px 4px 8px;
  background: transparent;
  /* Halo luminoso detrás de la furgoneta, sin borde ni fondo de tarjeta */
}
.hero-fleet::before {
  content: "";
  position: absolute;
  left: 6%; right: 6%;
  top: 4%; bottom: 30%;       /* sólo cubre la zona de la foto, no los badges */
  background:
    radial-gradient(60% 50% at 50% 50%, rgba(168,224,16,.20), transparent 70%),
    radial-gradient(80% 60% at 60% 40%, rgba(201,164,76,.10), transparent 70%);
  filter: blur(12px);
  z-index: 0;
}
.van-photo {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.6));
  z-index: 1;
}

.fleet-badges {
  position: relative;
  margin-top: 14px;       /* separa de la foto */
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  z-index: 5;
}
.fleet-badge {
  background: rgba(11,13,15,.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(168,224,16,.30);
  padding: 8px 12px;
  border-radius: 12px;
  display: flex; align-items: baseline; gap: 8px;
}
.fleet-badge--gold {
  border-color: rgba(201,164,76,.32);
}
.fleet-badge--gold .fleet-badge__num { color: var(--gold-2); }
.fleet-badge__num {
  font-family: var(--font-display);
  color: var(--lime);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}
.fleet-badge__lbl {
  color: var(--ivory-2);
  font-size: 11.5px;
  max-width: 120px;
  line-height: 1.25;
}

/* Explainer / use cases */
.explainer { padding: 30px 22px 8px; }
.ex-title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--gold-2);
  margin: 0 0 10px;
  letter-spacing: .2px;
}
.ex-lead {
  color: var(--ivory-2);
  font-size: 15px;
  max-width: 64ch;
  margin: 0 0 18px;
}

.usecases {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.usecase {
  background: #14171c;
  border: 1px solid #20252c;
  border-radius: var(--r-md);
  padding: 14px;
}
.usecase .uc-ic {
  width: 38px; height: 38px;
  background: rgba(168,224,16,.10);
  color: var(--lime);
  border-radius: 12px;
  display: grid; place-items: center;
  margin-bottom: 8px;
}
.usecase b {
  display: block;
  font-size: 14.5px;
  margin-bottom: 2px;
}
.usecase span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

/* How it works (inline) */
.how-strip { padding: 28px 22px 8px; }
.steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.step {
  background: linear-gradient(180deg, #15181d, #11141a);
  border: 1px solid #20252c;
  border-radius: var(--r-md);
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
}
.step-num {
  position: absolute;
  right: 14px; top: 12px;
  font-family: var(--font-display);
  font-size: 42px;
  color: rgba(201,164,76,.15);
  font-weight: 600;
  line-height: 1;
}
.step b { display: block; font-size: 15px; margin-bottom: 2px; color: var(--ivory); }
.step span { display: block; color: var(--muted); font-size: 12.5px; }

/* Biz section */
.biz-section {
  margin: 30px 14px 0;
  padding: 22px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(201,164,76,.14), transparent 60%),
    linear-gradient(180deg, #1a1d22, #0e1115);
  border: 1px solid rgba(201,164,76,.20);
}
.biz-section h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ivory);
  margin: 8px 0 8px;
  font-weight: 500;
}
.biz-section p {
  color: var(--ivory-2);
  font-size: 14px;
  margin: 0 0 16px;
  max-width: 56ch;
}
.biz-section .btn { height: 46px; }

.fleet-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.fp-card {
  margin: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  position: relative;
}
.fp-card::before {
  content: "";
  position: absolute;
  inset: 20% 12% 25% 12%;
  background: radial-gradient(60% 60% at 50% 50%, rgba(168,224,16,.10), transparent 70%);
  filter: blur(6px);
  z-index: 0;
}
.fp-card img {
  position: relative;
  width: 100%; height: auto;
  display: block;
  z-index: 1;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.5));
}
.fp-card figcaption {
  color: var(--gold-2);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
}
.fp-card figcaption span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--font-ui);
  font-weight: 400;
  margin-top: 1px;
}
.fleet-foot {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  font-style: italic;
  margin: 12px 0 0;
}

/* Welcome foot */
.welcome-foot {
  margin: 30px 22px 12px;
  padding: 28px 22px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(70% 80% at 50% -10%, rgba(168,224,16,.10), transparent 60%),
    linear-gradient(180deg, #15181d, #0e1115);
  border: 1px solid #20252c;
  text-align: center;
}
.welcome-foot h3 {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--gold-2);
  margin: 0 0 6px;
  font-style: italic;
  font-weight: 500;
}
.welcome-foot p {
  color: var(--ivory-2);
  margin: 0 0 14px;
}
.welcome-foot .btn { min-width: 200px; }

/* ============================================================
   Direcciones guardadas (chips)
   ============================================================ */
.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 2px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #14171c;
  border: 1px solid #20252c;
  color: var(--ivory);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s var(--ease), transform .12s var(--ease), background .15s var(--ease);
}
.chip:hover { border-color: var(--gold-2); background: #181b21; }
.chip:active { transform: scale(.97); }
.chip svg { color: var(--gold-2); }
.chip--add {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
}
.chip--add svg { color: var(--lime); }
.chip.flash {
  background: rgba(168,224,16,.10);
  border-color: var(--lime);
}

/* ============================================================
   Mini-mapa en vivo
   ============================================================ */
.mini-map-wrap {
  margin: 6px 22px 14px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid #20252c;
  background: var(--night-3);
}
.mini-map {
  width: 100%;
  height: 180px;
  background: var(--night-3);
}
.mini-map-info {
  display: flex; gap: 18px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #15181d, #11141a);
  border-top: 1px solid #20252c;
}
.mini-map-info span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--ivory-2);
}
.mini-map-info svg { color: var(--lime); }
.mini-map-info strong { color: var(--gold-2); font-weight: 600; }

/* ============================================================
   When: Ahora / Programar
   ============================================================ */
.when-row { padding: 6px 22px 4px; }
.when-tabs {
  display: inline-flex;
  background: #14171c;
  border: 1px solid #20252c;
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.when-tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.when-tab:hover { color: var(--ivory); }
.when-tab.active {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1b1305;
}
.schedule-row { margin-top: 12px; }
.schedule-input {
  width: 100%;
  background: #14171c;
  border: 1px solid #20252c;
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--ivory);
  font-size: 15px;
  font-family: var(--font-ui);
  color-scheme: dark;
}
.schedule-input:focus {
  outline: none;
  border-color: var(--gold-2);
  background: #181b21;
}

/* Vehicle selector imágenes reales sobre tarjeta blanca */
.veh {
  position: relative;
}
.veh img {
  position: relative;
  width: 100%; max-width: 160px;
  height: auto;
  display: block;
  margin: 0 auto 6px;
  object-fit: contain;
  z-index: 1;
}
.veh .name, .veh .vol { position: relative; z-index: 1; }

/* B2B empresa banner */
.biz-card {
  margin: 14px 22px;
  padding: 18px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(201,164,76,.18), transparent 60%),
    linear-gradient(180deg, #1a1d22, #11141a);
  border: 1px solid #2a2f36;
  display: flex; align-items: center; gap: 14px;
}
.biz-card .ic {
  width: 44px; height: 44px;
  background: rgba(201,164,76,.15);
  color: var(--gold-2);
  border-radius: 12px;
  display: grid; place-items: center;
  flex: 0 0 44px;
}
.biz-card .lbl { font-weight: 600; }
.biz-card .sub { color: var(--muted); font-size: 12.5px; }
.biz-card .btn { height: 38px; padding: 0 14px; font-size: 13px; margin-left: auto; }

/* ============================================================
   DESKTOP / TABLET — ≥ 900px
   El mismo HTML se reorganiza: rail lateral + layouts a 2 columnas.
   ============================================================ */
@media (min-width: 900px) {

  body {
    background:
      radial-gradient(60% 50% at 50% -10%, rgba(201,164,76,.10), transparent 60%),
      radial-gradient(80% 60% at 0% 100%, rgba(168,224,16,.05), transparent 60%),
      var(--night-1);
  }

  /* Layout principal: rail + contenido */
  #app {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 30px 60px 240px;
    min-height: 100vh;
  }
  /* En welcome (landing pública) no hay rail, así que recuperamos el ancho izquierdo */
  body[data-screen="welcome"] #app { padding-left: 30px; }

  /* La tabbar mobile se transforma en rail vertical lateral */
  .tabbar {
    position: fixed;
    top: 0; bottom: 0;
    left: max(0px, calc(50vw - 590px));
    width: 220px;
    height: 100vh;
    max-width: 220px;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 110px 14px 24px;
    background: linear-gradient(180deg, rgba(11,13,15,.85), rgba(11,13,15,.55));
    backdrop-filter: blur(14px);
    border-right: 1px solid #1a1d22;
  }
  /* Logo del rail (clicable a Inicio) */
  .rail-brand {
    display: block;
    position: absolute;
    top: 26px; left: 20px; right: 14px;
    text-decoration: none;
    padding: 6px 6px;
    border-radius: 10px;
    transition: background .15s var(--ease), transform .12s var(--ease);
  }
  .rail-brand img {
    display: block;
    width: 170px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
  }
  .rail-brand span {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .6px;
    font-style: italic;
  }
  .rail-brand:hover { background: rgba(255,255,255,.02); }
  .rail-brand:active { transform: scale(.98); }
  .tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
  }
  .tab svg { width: 18px; height: 18px; }
  .tab.active {
    background: linear-gradient(90deg, rgba(201,164,76,.10), transparent);
    color: var(--gold-2);
  }
  .tab:hover:not(.active) { background: rgba(255,255,255,.03); }

  /* La topbar móvil oculta su logo en desktop (el rail ya lo lleva) */
  .topbar .brand-row { display: none; }
  .topbar .title { font-size: 24px; }

  /* Logo del hero en desktop: arriba y proporcionado */
  .hero-logo { max-width: 340px; margin: -12px 0 8px; }
  .foot-logo { height: 70px; }

  /* Welcome: hero a 2 columnas, secciones siguientes a ancho completo */
  [data-screen="welcome"] .hero-new {
    display: grid;
    grid-template-columns: 1.1fr 1fr;     /* texto algo más ancho */
    align-items: start;                    /* la foto se ancla arriba */
    gap: 60px;                             /* respiración entre columnas */
    padding: 12px 0 10px;
  }
  [data-screen="welcome"] .hero-fleet {
    margin-top: -10px;                     /* sube un poco la foto sobre el texto */
  }
  [data-screen="welcome"] .hero-copy h1 {
    font-size: 46px;
    line-height: 1.04;
    letter-spacing: -.6px;
  }
  [data-screen="welcome"] .hero-sub { font-size: 16px; max-width: 50ch; margin-bottom: 16px; }
  [data-screen="welcome"] .hero-fleet { padding: 8px; }
  [data-screen="welcome"] .hero-ctas .btn { min-width: 200px; }

  [data-screen="welcome"] .explainer { padding: 50px 0 10px; }
  [data-screen="welcome"] .ex-title { font-size: 32px; }
  [data-screen="welcome"] .ex-lead { font-size: 16px; }
  [data-screen="welcome"] .usecases { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  [data-screen="welcome"] .usecase { padding: 20px; }
  [data-screen="welcome"] .usecase b { font-size: 16px; }
  [data-screen="welcome"] .usecase span { font-size: 13.5px; }

  [data-screen="welcome"] .how-strip { padding: 50px 0 10px; }
  [data-screen="welcome"] .steps-grid { grid-template-columns: repeat(4, 1fr); }
  [data-screen="welcome"] .step { padding: 22px 18px; }
  [data-screen="welcome"] .step-num { font-size: 60px; }
  [data-screen="welcome"] .step b { font-size: 17px; }

  [data-screen="welcome"] .biz-section {
    margin: 50px 0 0;
    padding: 36px;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 36px;
    align-items: center;
  }
  [data-screen="welcome"] .biz-section h3 { font-size: 30px; }
  [data-screen="welcome"] .biz-section p { font-size: 15px; }
  [data-screen="welcome"] .fleet-photos { grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }

  [data-screen="welcome"] .welcome-foot {
    margin: 50px 0 12px;
    padding: 44px 22px;
  }
  [data-screen="welcome"] .welcome-foot h3 { font-size: 36px; }

  /* Vehicle selector con fotos grandes */
  .veh img { max-width: 200px; }

  /* Home */
  [data-screen="home"] .hero { padding: 20px 0 18px; }
  [data-screen="home"] .hero h1 { font-size: 40px; }
  [data-screen="home"] .field { padding: 0; max-width: 640px; }
  [data-screen="home"] .field .btn { height: 64px; font-size: 17px; }
  [data-screen="home"] .section-title { margin-left: 0; margin-right: 0; font-size: 20px; }
  [data-screen="home"] .list { padding: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

  /* Pedido form */
  [data-screen="pedido"] .hero h1 { font-size: 36px; }
  [data-screen="pedido"] .field { padding: 0; max-width: 100%; }
  [data-screen="pedido"] .actions { padding: 18px 0 0; max-width: 100%; }
  [data-screen="pedido"] .actions .btn-block { max-width: 340px; }

  /* Vehiculo */
  [data-screen="vehiculo"] .hero h1 { font-size: 36px; }
  [data-screen="vehiculo"] .vehicle-grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 0;
    gap: 14px;
  }
  [data-screen="vehiculo"] .veh { padding: 24px 14px; }
  [data-screen="vehiculo"] .veh svg { width: 88px; height: 56px; }
  [data-screen="vehiculo"] .slider-row { padding: 22px 0; max-width: 100%; }
  [data-screen="vehiculo"] .actions { padding: 14px 0 0; }
  [data-screen="vehiculo"] .actions .btn-block { max-width: 340px; }

  /* Tarifa: 2 columnas */
  [data-screen="tarifa"] .hero h1 { font-size: 36px; }
  [data-screen="tarifa"] .tarifa-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 22px;
    align-items: start;
  }
  [data-screen="tarifa"] .fare-card { margin: 0; }
  [data-screen="tarifa"] .fare-total { font-size: 64px; }
  [data-screen="tarifa"] .actions {
    padding: 22px;
    position: sticky;
    top: 30px;
    background: linear-gradient(180deg, #15181d, #11141a);
    border: 1px solid #20252c;
    border-radius: var(--r-lg);
  }
  [data-screen="tarifa"] .actions .btn { width: 100%; }

  /* Tracking: mapa + panel lateral */
  [data-screen="tracking"] .tracking-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 22px;
    align-items: start;
  }
  [data-screen="tracking"] #map {
    height: 72vh;
    min-height: 520px;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid #1f242b;
  }
  [data-screen="tracking"] .driver-card { margin: 0 0 14px; }
  [data-screen="tracking"] .phases { margin: 0; }
  [data-screen="tracking"] .actions { padding: 14px 0 0; }

  /* Perfil */
  [data-screen="perfil"] .list {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Searching */
  [data-screen="searching"] .hero { padding-top: 60px; }
  [data-screen="searching"] .actions .btn-block { max-width: 340px; margin: 0 auto; }

  /* Cards / sections desktop */
  .card, .card-soft { padding: 22px; }
  .section-title { font-size: 20px; padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; }

  /* Banner B2B en pantalla grande */
  .biz-card { margin: 18px 0; padding: 22px; }
  .biz-card .ic { width: 52px; height: 52px; flex: 0 0 52px; }
  .biz-card .lbl { font-size: 17px; }

  /* Install banner - abajo, para no tapar el chip de sesión de la cabecera */
  .install-banner { bottom: 24px; }
}

/* Pantallas grandes */
@media (min-width: 1400px) {
  #app { max-width: 1320px; padding-left: 280px; }
  .tabbar { left: max(0px, calc(50vw - 660px)); width: 260px; }
  [data-screen="welcome"] .hero h1 { font-size: 72px; }
}
