/* =========================================================
   App de clientes — capa móvil sobre base.css (estilos del sitio)
   ========================================================= */
:root {
  --navy: #0b1220;
  --navy-2: #111a2e;
  --top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --tabbar-h: 64px;
}
html, body { height: 100%; }
body { background: var(--bg); overscroll-behavior: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; font-family: system-ui, -apple-system, 'Roboto', 'Segoe UI', sans-serif; }
input, textarea, select { user-select: text; -webkit-user-select: text; }
#app { min-height: 100%; }
.screen { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + var(--bottom) + 24px); animation: entrar .18s ease; }
.screen.no-tabs { padding-bottom: calc(var(--bottom) + 110px); }
@keyframes entrar { from { opacity: .4; transform: translateX(10px); } }
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--navy); }
.spinner { width: 34px; height: 34px; border: 4px solid rgba(96, 165, 250, .25); border-top-color: #60a5fa; border-radius: 50%; animation: girar .8s linear infinite; margin: 0 auto; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Barra superior ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy); color: #fff;
  padding: calc(var(--top) + 10px) 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.appbar .back { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; flex: none; }
.appbar .back svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.appbar h1 { color: #fff; font-size: 18px; font-weight: 800; }
.appbar p { color: #94a3b8; font-size: 12.5px; margin-top: 1px; }
.content { padding: 16px; }

/* ---------- Bienvenida ---------- */
.welcome { min-height: 100vh; background: var(--navy) url('../img/hero.svg') center bottom / cover no-repeat; display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--top) + 40px) 20px calc(var(--bottom) + 24px); }
.welcome-top { text-align: center; color: #cbd5e1; }
.logo-xl { width: 88px; height: 88px; border-radius: 24px; background: linear-gradient(135deg, #1d4ed8, #3b82f6); display: grid; place-items: center; margin: 0 auto 22px; box-shadow: 0 20px 40px rgba(29, 78, 216, .45); }
.logo-xl svg { width: 52px; height: 52px; }
.welcome h1 { color: #fff; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.welcome h1 span { color: #60a5fa; }
.welcome-card { background: rgba(15, 23, 42, .78); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, .08); border-radius: 26px; padding: 20px; }
.feat { color: #e2e8f0; font-weight: 700; padding: 8px 2px; display: flex; gap: 10px; font-size: 15px; }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .35); }

/* ---------- Formularios de cuenta ---------- */
.auth { padding: 20px 16px; }
.auth .card { padding: 20px; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px; }

/* ---------- Inicio ---------- */
.home-head { background: var(--navy) url('../img/hero.svg') center 70% / cover no-repeat; padding: calc(var(--top) + 18px) 18px 76px; color: #cbd5e1; position: relative; }
.home-head::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 18, 32, .2), rgba(11, 18, 32, .65)); }
.home-head > * { position: relative; z-index: 1; }
.home-head .saludo { font-size: 14px; font-weight: 600; }
.home-head h1 { color: #fff; font-size: 25px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.avatar { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, #1d4ed8, #7c3aed); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; font-size: 16px; }
.avatar.xl { width: 74px; height: 74px; border-radius: 22px; font-size: 28px; }
.search-card { background: #fff; border-radius: 24px; padding: 16px; margin: -58px 14px 0; position: relative; z-index: 2; box-shadow: 0 18px 40px rgba(15, 23, 42, .14); }
.tabs-2 { display: grid; grid-template-columns: 1fr 1fr; background: var(--line-2); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.tabs-2 button { border: 0; background: transparent; border-radius: 11px; padding: 10px; font: inherit; font-weight: 800; font-size: 14px; color: var(--muted); }
.tabs-2 button.on { background: #fff; color: var(--blue); box-shadow: 0 2px 6px rgba(15, 23, 42, .1); }
.od-box { border: 1.5px solid var(--line); border-radius: 16px; position: relative; }
.od-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.od-row + .od-row { border-top: 1.5px solid var(--line); }
.od-dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--blue-2); flex: none; }
.od-dot.fin { border-color: var(--purple); background: var(--purple); }
.od-row .grow small { display: block; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.od-row select { width: 100%; border: 0; font: inherit; font-size: 16px; font-weight: 800; color: var(--ink); background: transparent; padding: 2px 0; appearance: none; -webkit-appearance: none; outline: none; }
.swap-btn { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--blue); font-size: 18px; z-index: 1; }
.date-row { display: flex; gap: 8px; align-items: center; }
.date-row .chip { padding: 10px 12px; }
.date-row input { flex: 1; min-width: 0; }
.next-trip { background: linear-gradient(135deg, #1d4ed8, #6d28d9); color: #dbeafe; border-radius: 22px; padding: 16px; display: block; margin-top: 16px; box-shadow: 0 14px 30px rgba(29, 78, 216, .3); border: 0; width: 100%; text-align: left; font: inherit; }
.next-trip b { color: #fff; }
.next-trip .big { font-size: 22px; font-weight: 800; color: #fff; }
.info-tile { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-top: 12px; color: var(--text); }
.info-tile .i { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: none; }

/* ---------- Resultados ---------- */
.trip-row { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 14px; font: inherit; color: var(--text); box-shadow: var(--shadow); }
.trip-row + .trip-row { margin-top: 12px; }
.trip-row:disabled { opacity: .5; }
.tr-time { min-width: 70px; }
.tr-time b { display: block; font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.tr-time span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.tr-mid { flex: 1; min-width: 0; }
.tr-unit { font-weight: 800; color: var(--ink); font-size: 15px; }
.tr-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-free { display: inline-block; margin-top: 5px; background: #dcfce7; color: #15803d; font-size: 11.5px; font-weight: 800; border-radius: 7px; padding: 2px 8px; }
.tr-free.low { background: #fef3c7; color: #b45309; }
.tr-free.none { background: var(--red-100); color: var(--red); }
.tr-price { text-align: right; }
.tr-price b { display: block; font-size: 20px; font-weight: 800; color: var(--blue); }
.tr-price s { font-size: 12px; color: var(--faint); font-weight: 700; }
.tr-price small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.ida-sel { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; }
.rt-banner { background: var(--green-50); border: 1px solid var(--green-100); color: #047857; border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; }
.rt-banner b { font-size: 22px; }

/* ---------- Asientos ---------- */
.leg-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.leg-switch button { border: 0; border-radius: 16px; padding: 12px; font: inherit; font-weight: 800; background: #fff; color: var(--muted); border: 1.5px solid var(--line); }
.leg-switch button.on.ida { background: var(--blue); border-color: var(--blue); color: #fff; }
.leg-switch button.on.reg { background: var(--purple); border-color: var(--purple); color: #fff; }
.van { max-width: 310px; }

/* ---------- Barra inferior fija de acción ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  padding: 12px 16px calc(var(--bottom) + 12px);
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .08);
}
.action-bar .sum { flex: 1; min-width: 0; }
.action-bar .sum small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action-bar .sum b { font-size: 22px; color: var(--ink); font-weight: 800; }
.action-bar .btn { padding: 14px 20px; }

/* ---------- Pago ---------- */
.sum-card .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.sum-card .row:last-child { border-bottom: 0; }
.sum-card .row span:first-child { color: var(--muted); }
.sum-card .row span:last-child { font-weight: 800; color: var(--ink); text-align: right; }
.timer-pill { display: inline-flex; gap: 6px; align-items: center; background: var(--amber-50); color: #b45309; border: 1px solid #fde68a; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 800; }
.total-big { background: linear-gradient(160deg, #1e3a8a, #1e40af); color: #dbeafe; border-radius: 22px; padding: 18px; margin-top: 14px; }
.total-big b { display: block; color: #fff; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }

/* ---------- Boleto ---------- */
.ok-head { text-align: center; padding: 6px 0 16px; }
.ok-head .check { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 32px; margin: 0 auto 10px; animation: pop .35s ease; box-shadow: 0 12px 26px rgba(22, 163, 74, .35); }
.ok-head h2 { font-size: 23px; }
.ticket-zone { --notch: var(--bg); }

/* ---------- Mis viajes ---------- */
.page-head-m { background: var(--navy); color: #fff; padding: calc(var(--top) + 18px) 18px 18px; }
.page-head-m h1 { color: #fff; font-size: 26px; }
.page-head-m p { color: #94a3b8; font-size: 13.5px; margin-top: 2px; }
.trip-card { width: 100%; display: block; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; font: inherit; color: var(--text); box-shadow: var(--shadow); }
.trip-card + .trip-card { margin-top: 12px; }
.trip-card .od { font-weight: 800; color: var(--ink); font-size: 16px; }
.trip-card .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.trip-card.past { opacity: .72; }

/* ---------- Perfil ---------- */
.profile-head { background: var(--navy); color: #cbd5e1; padding: calc(var(--top) + 24px) 18px 26px; text-align: center; }
.profile-head h1 { color: #fff; font-size: 22px; margin-top: 12px; }
.menu-list { background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.menu-list a, .menu-list button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px 16px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); text-align: left; border-bottom: 1px solid var(--line-2); }
.menu-list > :last-child { border-bottom: 0; }
.menu-list .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; flex: none; background: var(--line-2); }
.menu-list .danger { color: var(--red); }
.version { text-align: center; color: var(--faint); font-size: 12px; margin-top: 18px; padding: 8px; }

/* ---------- Barra de pestañas ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--bottom); height: calc(var(--tabbar-h) + var(--bottom));
}
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--faint); }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.on { color: var(--blue); }
.tabbar button.on svg { stroke-width: 2.4; }

.empty-m { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-m .e { font-size: 44px; margin-bottom: 8px; }
.loading-m { padding: 60px 16px; text-align: center; color: var(--muted); font-weight: 700; }
.loading-m .spinner { margin-bottom: 12px; }
.toasts { bottom: calc(var(--tabbar-h) + var(--bottom) + 16px); }
.modal-backdrop { padding-bottom: 0; }
.modal { padding-bottom: var(--bottom); }

/* Forma de pago */
.pay-opt { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 20px; padding: 18px 16px; font: inherit; color: var(--ink); box-shadow: var(--shadow); font-size: 22px; }
.pay-opt + .pay-opt { margin-top: 12px; }
.pay-opt .i { width: 52px; height: 52px; border-radius: 16px; background: var(--blue-50); display: grid; place-items: center; font-size: 26px; flex: none; }
.pay-opt b { display: block; font-size: 16.5px; }
.pay-opt small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.ico-orange { background: #ffedd5; } .ico-green { background: #d1fae5; } .ico-blue { background: #dbeafe; }

.logo-xl.con-logo { background: #fff; width: 132px; height: 132px; border-radius: 32px; padding: 6px; box-shadow: 0 20px 40px rgba(0, 0, 0, .35); }

/* Versión web en computadora: la app se muestra como una columna centrada */
@media (min-width: 700px) {
  html { background: #0b1220 url('../img/hero.svg') center / cover fixed no-repeat; }
  body { background: transparent; }
  #app { max-width: 480px; margin: 0 auto; background: var(--bg); min-height: 100vh; box-shadow: 0 0 60px rgba(0, 0, 0, .45); position: relative; }
  .tabbar, .action-bar { max-width: 480px; margin: 0 auto; }
  .appbar { padding-top: 14px; }
}

/* ===== Modo fácil (página web sin cuenta) ===== */
.facil-head { background: var(--navy) url('../img/hero.svg') center 70% / cover no-repeat; display: flex; align-items: center; gap: 14px; padding: calc(var(--top) + 18px) 18px 22px; color: #cbd5e1; }
.facil-head h1 { color: #fff; font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.facil-head p { font-size: 13px; margin-top: 2px; }
.facil-logo { width: 64px; height: 64px; border-radius: 18px; background: #fff; padding: 3px; flex: none; overflow: hidden; display: grid; place-items: center; }
.facil-logo svg { width: 40px; height: 40px; stroke: var(--blue); }
.facil-inicio { flex: none; align-self: flex-start; padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.facil .paso { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: var(--ink); margin: 22px 0 12px; }
.facil .paso:first-child { margin-top: 4px; }
.paso span { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 15px; flex: none; }
.ruta-f { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 16px 14px; font: inherit; color: var(--ink); box-shadow: var(--shadow); }
.ruta-f + .ruta-f { margin-top: 10px; }
.ruta-f .ico { font-size: 26px; }
.ruta-f b { display: block; font-size: 17px; }
.ruta-f small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ruta-f .precio { font-weight: 800; color: var(--blue); font-size: 18px; }
.ruta-f.on { border-color: var(--blue-2); background: var(--blue-50); box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
.dias-f { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.dia-f { position: relative; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 8px; font: inherit; font-weight: 800; font-size: 15px; color: var(--ink); text-align: center; cursor: pointer; overflow: hidden; }
.dia-f.on { border-color: var(--blue-2); background: var(--blue); color: #fff; }
.dia-f.otra input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.redondo-f { display: flex; gap: 12px; align-items: center; background: #fff; border: 2px dashed var(--line); border-radius: 16px; padding: 14px; margin-top: 14px; cursor: pointer; }
.redondo-f input { width: 22px; height: 22px; accent-color: var(--purple); flex: none; }
.redondo-f b { display: block; color: var(--ink); }
.redondo-f small { color: var(--muted); font-size: 12.5px; }
.redondo-f.on { border-style: solid; border-color: var(--purple); background: var(--purple-50); }
.sub-f { font-weight: 800; color: var(--purple); margin: 12px 0 8px; }
.pista { color: var(--muted); font-size: 14px; text-align: center; padding: 14px; background: #fff; border-radius: 14px; border: 1px dashed var(--line); }
.hora-f { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px 14px; font: inherit; color: var(--ink); box-shadow: var(--shadow); margin-top: 10px; }
.hora-f:disabled { opacity: .5; }
.hora-f .h b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.hora-f .h small, .hora-f .grow small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; margin-top: 3px; }
.hora-f .libres { display: inline-block; background: #dcfce7; color: #15803d; font-size: 12.5px; font-weight: 800; border-radius: 8px; padding: 3px 9px; }
.hora-f .libres.pocos { background: #fef3c7; color: #b45309; }
.hora-f .precio { font-size: 20px; font-weight: 800; color: var(--blue); text-align: right; }
.hora-f .precio s { display: block; font-size: 12px; color: var(--faint); }
.hora-f .ir { font-size: 26px; color: var(--faint); }
.buscar-codigo { display: flex; gap: 8px; }
.buscar-codigo .input { flex: 1; min-width: 0; font-size: 14px; }
.ayuda-btn { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; color: var(--ink); box-shadow: var(--shadow); margin-bottom: 12px; }
.ayuda-btn span { font-size: 28px; }
.ayuda-btn b { font-size: 17px; }
.ayuda-btn small { margin-left: auto; color: var(--muted); font-weight: 700; }
.ayuda-btn.wa { background: #16a34a; color: #fff; border-color: #16a34a; }
