/* ==========================================================================
   RunGoPro — app del conductor. Modo oscuro (se usa a la intemperie y de noche),
   botones grandes, una acción principal por pantalla. Marca: lima #CCFF00 / amarillo #FFFF00.
   ========================================================================== */

:root {
  --bg:        #18181B;
  --surface:   #232327;
  --surface-2: #2E2E33;
  --line:      #3A3A40;
  --text:      #FFFFFF;
  --soft:      #A1A1AA;
  --lime:      #CCFF00;
  --lime-deep: #C4DB18;
  --yellow:    #FFFF00;
  --ink:       #18181B;
  --danger:    #FF7A7A;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.4; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }

/* ---------- Estructura ---------- */

.app {
  position: relative; display: flex; flex-direction: column;
  width: 100%; max-width: 480px; height: 100vh; height: 100dvh; margin: 0 auto;
  overflow: hidden; background: var(--bg);
}
@media (min-width: 520px) { .app { box-shadow: 0 0 0 1px #2b2b30, 0 0 60px rgba(0,0,0,.6); } }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); overflow-y: auto; z-index: 5; }

.app-header {
  flex: none; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  height: calc(56px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 8px 0 var(--gutter);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { height: 30px; width: auto; }
.pill {
  padding: 3px 9px; border-radius: 999px;
  background: var(--lime); color: var(--ink);
  font-size: .72rem; font-weight: 800; letter-spacing: .04em;
}
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.icon-btn svg { width: 24px; height: 24px; }

/* ---------- Botones ---------- */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 0 18px;
  font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; text-align: center; text-decoration: none;
  border-radius: 14px; border: 2px solid transparent;
  transition: transform .1s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn--primary { background: var(--lime); color: var(--ink); border-color: var(--lime-deep); }
.btn--primary:hover { filter: brightness(.96); }
.btn--ghost { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--sm { min-height: 46px; font-size: 1rem; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Mapa y panel ---------- */

.map { position: relative; flex: 1; min-height: 160px; background: #1c1c20; }
/* Botón "centrar en mi ubicación" (mismo que la app de pasajeros) */
.mapa-ubicacion {
  position: absolute; z-index: 3; top: 10px; right: 10px;
  display: grid; place-items: center; width: 44px; height: 44px;
  background: #fff; color: var(--ink); border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}
.mapa-ubicacion svg { width: 24px; height: 24px; }

.sheet {
  position: relative; z-index: 2; flex: none; margin-top: -16px;
  max-height: 62dvh; overflow-y: auto;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,.35);
}

.status { display: flex; align-items: center; gap: 10px; }
.status__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--soft); flex: none; }
.status.is-on .status__dot { background: var(--lime); box-shadow: 0 0 0 0 rgba(204,255,0,.6); animation: pulso 1.8s infinite; }
@keyframes pulso { 70% { box-shadow: 0 0 0 10px rgba(204,255,0,0); } 100% { box-shadow: 0 0 0 0 rgba(204,255,0,0); } }
.status__txt { flex: 1; min-width: 0; }
.status__title { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.status__sub { font-size: .82rem; color: var(--soft); }
.status .btn { width: auto; min-height: 44px; padding: 0 16px; font-size: .95rem; }

.offline { text-align: center; padding: 6px 0 2px; }
.offline__t { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.offline__s { margin: 6px auto 16px; max-width: 30ch; font-size: .92rem; color: var(--soft); }

.aviso { margin-top: 10px; padding: 10px 12px; font-size: .85rem; font-weight: 700; color: var(--yellow); background: rgba(255,255,0,.08); border-radius: 10px; }

/* ---------- Pedidos ---------- */

.lista { list-style: none; margin-top: 12px; display: grid; gap: 10px; }
.vacio { margin-top: 18px; text-align: center; color: var(--soft); font-size: .95rem; }
.vacio strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 1.05rem; }

.card { padding: 14px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 16px; }
.card.is-sel { border-color: var(--lime); }
.card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card__near { font-size: .8rem; font-weight: 800; color: var(--lime); }
.card__precio { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ruta { margin-top: 8px; display: grid; gap: 6px; }
.ruta__p { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; font-weight: 700; }
.ruta__p i { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--lime); }
.ruta__p.dest i { border-radius: 2px; background: var(--text); }
.ruta__p small { display: block; font-weight: 500; color: var(--soft); }
.card__acc { margin-top: 12px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.card__enviada { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(204,255,0,.1); font-size: .9rem; font-weight: 700; color: var(--lime); }
.card__enviada .btn { margin-top: 8px; }

.stepper { margin-top: 12px; }
.stepper__fila { display: flex; align-items: center; justify-content: center; gap: 14px; }
.stepper__v { min-width: 8ch; text-align: center; font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.stepper__b { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line); font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stepper__b:active { background: var(--lime); color: var(--ink); }
.stepper__b:disabled { opacity: .35; }
.stepper__acc { margin-top: 10px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }

/* ---------- Viaje en curso ---------- */

.viaje__paso { font-size: .8rem; font-weight: 800; color: var(--lime); }
.viaje__titulo { margin-top: 2px; font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }
.viaje__destino { margin-top: 10px; padding: 12px; background: var(--surface-2); border-radius: 14px; font-size: 1rem; font-weight: 700; }
.viaje__destino small { display: block; font-weight: 500; color: var(--soft); }
.viaje__pas { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.viaje__pas small { display: block; font-weight: 500; color: var(--soft); }
.viaje__precio { font-size: 1.5rem; font-weight: 800; }
.viaje__acc { margin-top: 12px; display: grid; gap: 8px; }
.viaje__acc2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.resumen { text-align: center; padding: 6px 0; }
.resumen__t { font-size: 1.4rem; font-weight: 800; }
.resumen__m { margin: 6px 0 14px; font-size: 2.2rem; font-weight: 800; color: var(--lime); letter-spacing: -.02em; }

.rate { margin: 4px 0 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.rate__pregunta { font-size: 1rem; font-weight: 800; }
.rate__estrellas { margin-top: 8px; display: flex; justify-content: center; gap: 4px; }
.rate__estrella {
  width: 44px; height: 44px;
  font-size: 2rem; line-height: 1;
  color: var(--line);
  transition: color .1s, transform .1s;
}
.rate__estrella:active { transform: scale(.9); }
.rate__estrella.is-on { color: #FFB800; }
.rate__comentario {
  display: block; width: 100%; margin-top: 10px; padding: 10px 12px;
  min-height: 64px; resize: vertical;
  font: inherit; font-size: .92rem; color: var(--text);
  background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: 12px;
}
.rate .btn { margin-top: 10px; }
.rate__gracias { margin-top: 8px; font-size: .95rem; font-weight: 700; color: var(--text); }

/* ---------- Billetera ---------- */

.app-header__actions { display: flex; align-items: center; gap: 4px; }
.wallet-chip {
  display: flex; align-items: center; height: 36px; padding: 0 12px;
  background: var(--surface-2); border: 1.5px solid var(--lime-deep); border-radius: 999px;
  font-size: .95rem; font-weight: 800; color: var(--lime);
}
.wallet-chip.is-bloqueada { border-color: var(--danger); color: var(--danger); }

.billetera-sheet { max-height: none; flex: 1; overflow-y: auto; }
.wallet-saldo { text-align: center; padding: 8px 0 18px; border-bottom: 1px solid var(--line); }
.wallet-saldo__label { font-size: .85rem; color: var(--soft); font-weight: 700; }
.wallet-saldo__valor { margin-top: 2px; font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; }
.wallet-saldo__gracia { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(204,255,0,.1); color: var(--lime); font-size: .85rem; font-weight: 700; }
.wallet-saldo__tarifa { margin-top: 8px; font-size: .82rem; color: var(--soft); }

.billetera-h2 { margin-top: 22px; font-size: 1.05rem; font-weight: 800; }
.billetera-p { margin-top: 4px; font-size: .85rem; color: var(--soft); }
#form-recarga .field { margin-top: 12px; }
#form-recarga .field label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 800; }
#form-recarga input {
  width: 100%; height: 48px; padding: 0 14px; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px;
}
#form-recarga input[type=file] { padding: 10px 14px; height: auto; }
#recarga-enviar { margin-top: 16px; }

.pendiente-recarga {
  margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: rgba(255,184,0,.1); border: 1px solid rgba(255,184,0,.35);
  font-size: .9rem; font-weight: 700; color: #FFB800;
}

.billetera-historial { list-style: none; margin-top: 8px; }
.billetera-historial li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.billetera-historial .mov__nota { color: var(--soft); font-size: .78rem; margin-top: 2px; }
.billetera-historial .mov__monto.is-pos { color: var(--lime); font-weight: 800; }
.billetera-historial .mov__monto.is-neg { color: var(--text); font-weight: 800; }
.billetera-vacio { margin-top: 16px; text-align: center; color: var(--soft); font-size: .9rem; }

/* ---------- Marcadores ---------- */

.pin { width: 18px; height: 18px; border-radius: 50%; background: var(--lime); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--lime); }
.pin--sel { width: 26px; height: 26px; }
/* Mismos marcadores que la app de pasajeros (rungo.css): punto azul del conductor, destino y punto de recogida */
.pin-yo { width: 16px; height: 16px; border-radius: 50%; background: #1A73E8; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26, 115, 232, .25); }
.pin-destino, .pin-recogida { display: flex; flex-direction: column; align-items: center; }
.pin-destino__marca { width: 26px; height: 26px; border-radius: 8px; background: var(--bg); border: 4px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .35); }
.pin-destino__punta, .pin-recogida__punta { width: 0; height: 0; margin-top: -1px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--bg); }
.pin-recogida__marca { display: grid; place-items: center; width: 36px; height: 36px; background: var(--bg); color: #fff; border-radius: 11px; box-shadow: 0 3px 10px rgba(0, 0, 0, .35); }
.pin-recogida__marca svg { width: 22px; height: 22px; }

/* ---------- Pantallas de texto (bienvenida, revisión) ---------- */

.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px 8px; text-align: center; }
.hero__logo { width: min(64%, 240px); }
.hero__pro { margin-top: 10px; }
.hero__t { margin-top: 26px; font-size: clamp(1.7rem, 7vw, 2.1rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; color: var(--yellow); text-wrap: balance; }
.hero__s { margin-top: 10px; max-width: 30ch; font-size: 1.05rem; font-weight: 300; text-wrap: balance; }
.beneficios { list-style: none; margin: 22px 0 0; display: grid; gap: 10px; text-align: left; }
.beneficios li { display: flex; gap: 10px; align-items: flex-start; font-size: .98rem; font-weight: 700; }
.beneficios li::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--lime); }
.acciones { padding: 8px 24px 8px; display: grid; gap: 10px; }
.legal { padding: 12px 24px calc(22px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: .74rem; font-weight: 300; line-height: 1.65; color: var(--soft); }

.revision { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px; text-align: center; }
.revision__ico { width: 72px; height: 72px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: rgba(204,255,0,.12); }
.revision__ico svg { width: 36px; height: 36px; color: var(--lime); }
.revision__t { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.revision__s { margin: 10px auto 22px; max-width: 32ch; color: var(--soft); }
.revision__datos { margin: 0 auto 22px; padding: 12px 16px; background: var(--surface); border-radius: 14px; font-size: .92rem; font-weight: 700; text-align: left; }
.revision__datos span { display: block; color: var(--soft); font-weight: 500; font-size: .8rem; }

/* ---------- Menú ---------- */

.backdrop { position: absolute; inset: 0; z-index: 10; background: rgba(0,0,0,.6); }
.drawer {
  position: absolute; z-index: 11; top: 0; right: 0; bottom: 0; width: min(86%, 340px);
  display: flex; flex-direction: column; overflow-y: auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
}
.drawer__top { display: flex; align-items: center; justify-content: space-between; }
.drawer__quien { margin-top: 20px; }
.drawer__nombre { font-size: 1.2rem; font-weight: 800; color: var(--yellow); }
.drawer__datos { font-size: .88rem; color: var(--soft); }
.drawer__nav { margin-top: 18px; display: grid; }
.drawer__nav a, .drawer__nav button { display: block; width: 100%; text-align: left; padding: 15px 4px; font-size: 1.02rem; font-weight: 800; text-decoration: none; border-bottom: 1px solid var(--line); }
.drawer__legal { margin-top: auto; padding-top: 24px; font-size: .76rem; font-weight: 300; line-height: 1.6; color: var(--soft); }

/* ---------- Formularios (registro / acceso) ---------- */

.page { min-height: 100%; }
.auth { width: 100%; max-width: 440px; margin: 0 auto; padding: clamp(24px, 6vw, 48px) 24px 0; }
.auth__logo { width: min(56vw, 200px); margin: 0 auto; }
.auth__title { margin-top: 24px; font-size: clamp(1.6rem, 6vw, 2rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: var(--yellow); text-align: center; text-wrap: balance; }
.auth__lead { margin-top: 8px; text-align: center; font-weight: 300; }

.form { margin-top: 22px; padding: 20px 16px; background: var(--surface); border-radius: 20px; }
.field + .field { margin-top: 14px; }
.field > label, .field > .lbl { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 800; }
.field input, .field select {
  width: 100%; height: 50px; padding: 0 14px; font: inherit; font-size: 1rem; font-weight: 500; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px; background-repeat: no-repeat; }
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--lime); outline-offset: 1px; border-color: var(--lime); }
.field input::placeholder { color: #7d7d86; }
.vpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vpick__op { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; background: var(--surface-2); border: 2px solid var(--line); border-radius: 14px; font-weight: 800; }
.vpick__op img { height: 40px; width: auto; margin-bottom: 4px; }
.vpick__op[aria-pressed="true"] { border-color: var(--lime); background: rgba(204,255,0,.1); }
.check { display: flex; gap: 10px; margin-top: 16px; font-size: .82rem; line-height: 1.4; color: var(--soft); }
.check input { flex: none; width: 22px; height: 22px; margin-top: 0; accent-color: var(--lime); }
.form .btn { margin-top: 18px; }
.form__status { margin-top: 12px; min-height: 1.2em; font-size: .88rem; font-weight: 700; text-align: center; color: var(--danger); }
.auth__alt { margin: 18px 0 0; text-align: center; }
.auth__alt a { font-weight: 800; color: var(--lime); }
.auth__back { display: block; margin-top: 10px; text-align: center; font-size: .85rem; color: var(--soft); }
.page .legal { max-width: 520px; margin: 24px auto 0; }

@media (max-height: 640px) { .sheet { max-height: 70dvh; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Contenedor del panel */
.panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* ---------- Documentos legales y eliminar cuenta ---------- */
.doc-page { min-height: 100%; background: var(--bg); color: var(--text); }
.doc__top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 4px; max-width: 720px; margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px 4px; background: var(--bg);
}
.doc__top h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.doc__volver { display: grid; place-items: center; width: 44px; height: 44px; color: var(--text); border-radius: 12px; }
.doc__volver svg { width: 24px; height: 24px; }
.doc__tabs { display: flex; gap: 8px; max-width: 720px; margin: 0 auto; padding: 4px 16px 12px; }
.doc__tabs a {
  flex: 1; display: grid; place-items: center; min-height: 44px; padding: 0 10px; text-align: center; text-decoration: none;
  font-size: .86rem; font-weight: 800; color: var(--soft); border: 1.5px solid var(--line); border-radius: 12px;
}
.doc__tabs a.is-on { color: var(--ink); background: var(--lime); border-color: var(--lime-deep); }
.doc { max-width: 720px; margin: 0 auto; padding: 22px 20px calc(36px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-radius: 20px 20px 0 0; min-height: 60vh; }
.doc__titulo { font-size: 1.35rem; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 10px; color: var(--yellow); }
.doc h3 { margin: 22px 0 6px; font-size: 1.05rem; font-weight: 800; }
.doc h4 { margin: 16px 0 4px; font-size: .95rem; font-weight: 800; }
.doc p, .doc li { font-size: .92rem; line-height: 1.6; color: #D4D4D8; }
.doc p { margin-top: 8px; }
.doc ul { margin: 8px 0 0 20px; }
.doc li { margin-top: 4px; }
.doc a { color: var(--lime); font-weight: 800; }
.doc__aviso { padding: 10px 12px; background: #3a3320; border-radius: 12px; }
.doc__aviso, .doc__aviso strong { color: #FFE9A0 !important; font-size: .82rem !important; }
mark.doc__pendiente { padding: 0 3px; background: #FFF1A8; color: var(--ink); border-radius: 4px; }
.doc__pie { margin-top: 28px !important; padding-top: 14px; border-top: 1px solid var(--line); font-size: .85rem !important; }
.doc__nota { color: var(--soft) !important; text-align: center; padding: 40px 0; }
.doc__alerta { padding: 12px 14px; background: var(--yellow); border-radius: 12px; font-weight: 700; color: var(--ink) !important; }
.doc__saldo { margin-top: 18px; padding: 14px; background: #3a3320; border: 2px solid #E4B800; border-radius: 14px; }
.doc__saldo p { margin: 0; font-size: 1rem; font-weight: 800; color: #FFE9A0; }
.doc__saldo.is-cero { background: #26301a; border-color: var(--lime-deep); }
.doc__saldo.is-cero p { color: #DDF08A; }
.doc__acciones { display: grid; gap: 10px; margin-top: 20px; }
.doc .field { margin-top: 16px; }
.doc .check { margin-top: 18px; font-size: .9rem; font-weight: 700; color: var(--text); }
.btn--peligro { background: #C6362B; color: #fff; border-color: #9E2A21; }
.btn--peligro:disabled { opacity: .45; }
.doc .form__status { min-height: 1.2em; margin-top: 12px; }
.check a { color: inherit; font-weight: 800; }
.drawer__nav a.is-peligro { color: var(--danger); }
.billetera-nota { font-size: .78rem; color: var(--soft); }
.billetera-nota a { color: inherit; font-weight: 800; }

/* Selector de ciudad del registro */
.ciudad-detectar { color: var(--lime); }
.ciudad-msg { color: var(--soft); }

.ciudad-detectar { margin-top: 8px; padding: 6px 2px; font-size: .85rem; font-weight: 800; text-decoration: underline; }
.ciudad-msg { margin-top: 4px; min-height: 1.1em; font-size: .8rem; font-weight: 700; }
