:root {
  --primary: #5b4cf5;
  --primary-soft: #eeebff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #f5f6fa;
  --white: #ffffff;
  --success: #22c55e;
  --success-soft: #dcfce7;
  --warn-soft: #fef3c7;
  --warn: #b45309;
  --navy: #171a3a;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #e9eaf0;
  font-size: 14px;
  line-height: 1.4;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h4 { font-size: 14px; margin-bottom: 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* Marco de móvil: pantalla completa en móvil, teléfono centrado en escritorio */
.phone {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--white);
  overflow: hidden;
}
@media (min-width: 600px) {
  body { display: flex; align-items: center; justify-content: center; }
  .phone {
    width: 390px; height: min(844px, 96vh);
    border-radius: 36px;
    box-shadow: 0 30px 80px rgba(17, 24, 39, .25), 0 0 0 10px #111;
  }
}

/* Pantallas */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--white);
  padding-top: var(--safe-top);
  opacity: 0; pointer-events: none;
  transform: translateX(24px);
  transition: opacity .22s ease, transform .22s ease;
}
.screen.is-active { opacity: 1; pointer-events: auto; transform: none; z-index: 1; }
.screen.is-back { transform: translateX(-24px); }

.content { padding: 12px 16px 0; display: flex; flex-direction: column; gap: 14px; flex: 1; position: relative; z-index: 1; }
.content.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 16px; }
.content.center { align-items: center; text-align: center; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { align-items: flex-end; }
.row.top { align-items: flex-start; }
.row.gap { gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.body { font-size: 13px; line-height: 1.55; }
.centered { text-align: center; max-width: 280px; }
.title { font-size: 22px; }

/* Bienvenida */
.blob { position: absolute; border-radius: 50%; z-index: 0; }
.blob-lilac { width: 360px; height: 360px; left: -120px; top: -40px; background: #ecebff; }
.blob-peach { width: 260px; height: 260px; right: -110px; top: -40px; background: #f9ddd0; }
.welcome { padding: 20px 24px 28px; gap: 12px; }
.welcome header { margin-bottom: 20px; }
.hero-title { font-size: 30px; line-height: 1.15; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.mark { width: 24px; height: 24px; border-radius: 6px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 11px; font-weight: 600; }
.pill svg { width: 12px; height: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.qr-card { align-self: center; margin-top: 28px; padding: 24px; border-radius: 20px; background: #fff; box-shadow: 0 8px 24px rgba(91, 76, 245, .13); }
.link { color: var(--muted); font-size: 13px; padding: 8px; }

/* QR falso (patrón determinista) */
.qr { display: grid; width: 172px; height: 172px; gap: 1px; }
.qr.big { width: 220px; height: 220px; }
.qr i { display: block; border-radius: 2px; background: transparent; }
.qr i.on { background: var(--ink); }
.qr i.acc { background: var(--primary); }
.qr i.f { background: var(--ink); }
.qr i.fw { background: #fff; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; height: 52px; border-radius: var(--radius); font-weight: 600; font-size: 15px; transition: transform .1s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:disabled { opacity: .45; }
.btn.outline { border: 1px dashed var(--primary); color: var(--primary); height: 44px; font-size: 13px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 16px; }
.nav-title { font-weight: 600; font-size: 16px; }
.icon-btn { width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; }
.icon-btn.ghost { background: var(--surface); }
.icon-btn.solid { background: var(--primary); color: #fff; border-radius: 12px; }
.icon-btn svg { width: 18px; height: 18px; }

/* Tarjeta de viaje */
.trip-card { position: relative; overflow: hidden; height: 120px; border-radius: 16px; background: var(--navy); color: #fff; padding: 16px; }
.trip-card .tb { position: absolute; border-radius: 50%; }
.tb1 { width: 120px; height: 120px; right: 30px; top: -30px; background: #f0a98a; }
.tb2 { width: 120px; height: 120px; right: -40px; top: 20px; background: var(--primary); }
.tb3 { width: 90px; height: 90px; right: 40px; top: 60px; background: #f4c9b5; }
.trip-card .tag { position: relative; display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .5px; padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,.13); }
.trip-card h2 { position: relative; font-size: 22px; margin-top: 6px; }
.trip-card p { position: relative; font-size: 12px; opacity: .7; margin-top: 4px; }
.section-title { display: flex; align-items: baseline; gap: 6px; }
.section-title h3 { font-size: 16px; }

/* Listas y tarjetas */
.list { display: flex; flex-direction: column; gap: 10px; }
.card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; text-align: left; width: 100%; }
.card.is-selected { border-color: var(--primary); box-shadow: inset 0 0 0 .5px var(--primary); }
.thumb { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; }
.thumb.soft { background: var(--primary-soft); color: var(--primary); }
.thumb.dark { background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; }
.thumb.blue { background: #0070e0; color: #fff; font-size: 18px; font-weight: 700; }
.thumb svg { width: 20px; height: 20px; }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.info strong { font-size: 13px; font-weight: 600; }
.info small, .info .desc { font-size: 11px; color: var(--muted); line-height: 1.35; }
.info .price { font-size: 11px; color: var(--muted); }
.info .price b { color: var(--primary); font-size: 13px; }
.check { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.check svg { width: 14px; height: 14px; }
.is-selected .check { background: var(--primary); color: #fff; }
.remove { flex: none; color: var(--muted); padding: 6px; }
.remove svg { width: 16px; height: 16px; }

/* Footer */
.footer { display: flex; align-items: center; gap: 12px; padding: 14px 16px calc(24px + var(--safe-bottom)); border-top: 1px solid var(--line); background: #fff; position: relative; z-index: 2; }
.footer.between { justify-content: space-between; }
.footer.plain { border-top: 0; }
.total { font-size: 20px; font-weight: 700; }

/* Detalle */
.cover { position: relative; overflow: hidden; height: 180px; border-radius: 18px; background: #fbd8ce; display: grid; place-items: center; font-size: 56px; }
.cover::before, .cover::after { content: ""; position: absolute; border-radius: 50%; }
.cover::before { width: 260px; height: 260px; right: -80px; top: -80px; background: #f5b3a3; }
.cover::after { width: 150px; height: 150px; right: -20px; bottom: -60px; background: #fbe6b8; }
.cover span { position: relative; }
.meta-row { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.meta-row span { display: inline-flex; align-items: center; gap: 4px; }
.meta-row svg { width: 13px; height: 13px; }
.includes { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.includes li { display: flex; align-items: center; gap: 8px; }
.includes li::before { content: "✓"; width: 18px; height: 18px; border-radius: 50%; background: var(--success-soft); color: #15803d; font-size: 11px; display: grid; place-items: center; }
.stepper { display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 14px; border-radius: var(--radius); background: var(--surface); font-weight: 700; font-size: 16px; }
.stepper button { font-size: 20px; width: 24px; }
.stepper .accent { color: var(--primary); }

/* Resumen */
.totals { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; font-size: 13px; }
.totals .big { font-size: 15px; }
.totals .big strong:last-child { font-size: 16px; }

/* Pago */
.card.select { cursor: pointer; }
.card.select input { position: absolute; opacity: 0; pointer-events: none; }
.radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); }
.is-selected .radio { border-color: var(--primary); background: var(--primary) center/12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.card-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface); transition: opacity .2s; }
.card-form.is-hidden { opacity: .35; }
.field { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #fff; }
.field label { font-size: 9px; font-weight: 600; letter-spacing: .6px; color: var(--muted); }
.field span { font-size: 14px; font-weight: 600; }
.field.grow { flex: 1; }
.pay-total strong { font-size: 22px; }

/* Confirmación */
.tint { position: absolute; inset: 0 0 auto; height: 260px; background: var(--success-soft); }
.success { width: 64px; height: 64px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; margin-top: 12px; }
.success svg { width: 30px; height: 30px; stroke-width: 3; }
.ticket { width: 100%; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(17, 24, 39, .08); text-align: left; }
.ticket-head { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; background: var(--navy); color: #fff; }
.ticket-head small { font-size: 9px; font-weight: 600; letter-spacing: .8px; opacity: .7; }
.ticket-head strong { font-size: 17px; }
.ticket-body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 18px; border-bottom: 1px solid var(--line); }
.code { font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.ticket-foot { display: flex; flex-direction: column; gap: 4px; padding: 12px 18px 14px; }

/* Mis actividades */
.segmented { display: flex; padding: 4px; border-radius: 12px; background: var(--surface); }
.segmented button { flex: 1; height: 34px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented button.is-on { background: var(--primary); color: #fff; }
.booking { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); }
.booking .top { display: flex; align-items: center; gap: 10px; }
.booking .thumb { width: 36px; height: 36px; font-size: 18px; border-radius: 9px; }
.badge { font-size: 10px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: var(--success-soft); color: #15803d; }
.badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.done { background: var(--surface); color: var(--muted); }
.qr-btn.light { background: var(--primary-soft); color: var(--primary); }
.booking .bottom { display: flex; align-items: center; justify-content: space-between; }
.paid small { display: block; font-size: 10px; color: var(--muted); }
.paid b { font-size: 14px; }
.qr-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.qr-btn svg { width: 13px; height: 13px; }
.tabbar { display: flex; justify-content: space-around; padding: 10px 24px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--line); background: #fff; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); width: 100px; }
.tabbar button.is-on { color: var(--primary); font-weight: 600; }
.tabbar svg { width: 22px; height: 22px; }
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; }

/* Hojas (idioma, QR) */
.sheet-wrap { position: absolute; inset: 0; z-index: 20; visibility: hidden; }
.sheet-wrap.is-open { visibility: visible; }
.scrim { position: absolute; inset: 0; background: rgba(15, 16, 32, .65); opacity: 0; transition: opacity .25s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 14px; padding: 12px 20px calc(28px + var(--safe-bottom)); border-radius: 24px 24px 0 0; background: #fff; transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.sheet.center { align-items: center; text-align: center; }
.sheet-wrap.is-open .scrim { opacity: 1; }
.sheet-wrap.is-open .sheet { transform: none; }
.grabber { width: 36px; height: 4px; border-radius: 2px; background: var(--line); align-self: center; }
.sheet h3 { font-size: 17px; }
.close { width: 28px; height: 28px; border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 12px; }
.lang { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); width: 100%; text-align: left; }
.lang.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.flag { width: 28px; height: 20px; border-radius: 4px; background: var(--surface); display: grid; place-items: center; font-size: 14px; }
.lang .info strong { font-size: 13px; }
.lang .info small { font-size: 11px; }

/* Toast */
.toast { position: absolute; left: 50%; bottom: calc(100px + var(--safe-bottom)); transform: translate(-50%, 10px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; opacity: 0; transition: .2s; z-index: 40; pointer-events: none; white-space: nowrap; }
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }
