/* =====================================================================
   Club Gerensys — App del cliente
   Pensada para todas las edades: letra grande, botones grandes, alto
   contraste, una acción principal por pantalla y textos claros.
   ===================================================================== */
:root {
  --brand: #0D2B73;
  --brand-2: #1747C2;
  --sky: #0094FF;
  --gold: #F59E0B;
  --gold-2: #D97706;
  --gold-soft: #FFF4D6;
  --ok: #15803D;
  --ok-soft: #DCFCE7;
  --danger: #B91C1C;
  --danger-soft: #FEE2E2;
  --bg: #F3F5FA;
  --card: #FFFFFF;
  --ink: #0F172A;
  --muted: #526077;
  --line: #E3E7EF;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 2px 6px rgba(15, 23, 42, .05), 0 10px 28px rgba(15, 23, 42, .07);
  --nav-h: 78px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.45; overflow-x: hidden;
}
a { color: var(--brand-2); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Estructura ─────────────────────────────────────────────────────── */
.app { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
.app.sin-nav { padding-bottom: 32px; }

.topbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.topbar .hola { flex: 1; min-width: 0; }
.topbar .hola small { display: block; color: var(--muted); font-size: .85rem; font-weight: 700; }
.topbar .hola h1 { margin: 0; font-size: 1.55rem; font-weight: 900; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 1.25rem; text-decoration: none; flex: none; overflow: hidden; border: 3px solid #fff; box-shadow: var(--shadow); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.back { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px 0 10px; border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 800; box-shadow: var(--shadow); margin-bottom: 14px; }
.back svg { width: 22px; height: 22px; }

h2.seccion { font-size: 1.15rem; font-weight: 900; margin: 26px 2px 12px; display: flex; align-items: center; justify-content: space-between; }
h2.seccion span { color: var(--muted); font-size: .85rem; font-weight: 800; }

/* ── Botones ────────────────────────────────────────────────────────── */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; padding: 12px 20px; border: 0; border-radius: 18px; font-weight: 900; font-size: 1.08rem; text-decoration: none; cursor: pointer; transition: transform .08s ease, filter .15s; text-align: center; }
.btn:active { transform: scale(.98); }
.btn svg { width: 26px; height: 26px; flex: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(13, 43, 115, .28); }
.btn-gold { background: linear-gradient(135deg, #FBBF24, var(--gold-2)); color: #3B1D00; box-shadow: 0 6px 18px rgba(217, 119, 6, .35); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-light { background: #fff; color: var(--brand); border: 2px solid var(--line); }
.btn-ghost { background: transparent; color: var(--brand-2); min-height: 52px; }
.btn-sm { min-height: 48px; font-size: .95rem; border-radius: 14px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-row { display: grid; gap: 12px; }

/* Botón grande "Escanear" en el inicio */
.scan-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; text-decoration: none; box-shadow: 0 10px 26px rgba(13, 43, 115, .32); }
.scan-hero .ico { width: 64px; height: 64px; border-radius: 18px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex: none; }
.scan-hero .ico svg { width: 38px; height: 38px; }
.scan-hero b { display: block; font-size: 1.35rem; font-weight: 900; line-height: 1.15; }
.scan-hero span { display: block; opacity: .9; font-size: .92rem; font-weight: 700; margin-top: 2px; }

/* ── Avisos ─────────────────────────────────────────────────────────── */
.aviso { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow); margin: 14px 0; }
.aviso .emo { font-size: 1.9rem; line-height: 1; flex: none; }
.aviso b { display: block; font-size: 1.02rem; }
.aviso p { margin: 3px 0 0; color: var(--muted); font-size: .92rem; }
.aviso .acciones { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.aviso .acciones .btn { width: auto; min-height: 46px; padding: 8px 16px; font-size: .95rem; }
.aviso.gold { background: var(--gold-soft); border: 2px solid #FCD34D; box-shadow: none; }
.aviso.ok { background: var(--ok-soft); box-shadow: none; }
.aviso.err { background: var(--danger-soft); color: #7F1D1D; box-shadow: none; }
.aviso.err p { color: #7F1D1D; }
.aviso .cerrar { margin-left: auto; background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; min-width: 40px; min-height: 40px; }

.premio-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: linear-gradient(135deg, #FFE7A3, #FBBF24); color: #3B1D00; text-decoration: none; margin-top: 16px; box-shadow: 0 8px 22px rgba(217, 119, 6, .3); animation: latido 2.2s ease-in-out infinite; }
.premio-banner .emo { font-size: 2.4rem; }
.premio-banner b { font-size: 1.15rem; display: block; font-weight: 900; }
.premio-banner span { font-weight: 700; font-size: .92rem; }
@keyframes latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015); } }

/* ── Tarjeta de fidelidad ───────────────────────────────────────────── */
.loy-card { display: block; position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; text-decoration: none; color: var(--ink); border: 2px solid transparent; }
.loy-card:active { transform: scale(.995); }
.loy-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--c, var(--brand)); color: var(--ct, #fff); }
.loy-logo { width: 52px; height: 52px; border-radius: 14px; background: #fff; flex: none; display: grid; place-items: center; overflow: hidden; color: var(--c, var(--brand)); font-weight: 900; font-size: 1.4rem; }
.loy-logo img { width: 100%; height: 100%; object-fit: cover; }
.loy-tit { flex: 1; min-width: 0; }
.loy-tit b { display: block; font-size: 1.12rem; font-weight: 900; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loy-tit span { display: block; font-size: .92rem; font-weight: 700; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 900; white-space: nowrap; background: rgba(255, 255, 255, .22); color: inherit; }
.chip.gold { background: #FFF4D6; color: #7A3E00; }
.chip.gris { background: #EEF1F6; color: #475569; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }

.loy-body { padding: 16px; }
.sellos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.sello { aspect-ratio: 1; border-radius: 50%; border: 3px dashed #C6CEDB; display: grid; place-items: center; font-weight: 900; color: #94A3B8; font-size: 1rem; max-width: 64px; width: 100%; justify-self: center; background: #fff; }
.sello.on { border: 3px solid var(--c, var(--brand)); background: var(--c, var(--brand)); color: var(--ct, #fff); font-size: 1.45rem; box-shadow: 0 3px 8px rgba(0, 0, 0, .12); }
.sello.gift { border: 3px solid var(--gold); background: var(--gold-soft); font-size: 1.45rem; }
.sello.gift.on { background: var(--gold); border-color: var(--gold-2); }
.sello.nuevo { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { 0% { transform: scale(.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.sellos.chicos { grid-template-columns: repeat(10, 1fr); gap: 6px; }
.sellos.chicos .sello { font-size: .78rem; border-width: 2px; }
.sellos.chicos .sello.on, .sellos.chicos .sello.gift { font-size: .95rem; }

.barra { height: 14px; border-radius: 999px; background: #E8ECF3; overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--brand)); }

.loy-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 800; font-size: 1rem; }
.loy-foot .txt { flex: 1; }
.loy-foot .txt small { display: block; color: var(--muted); font-weight: 700; font-size: .85rem; }
.loy-foot svg { width: 26px; height: 26px; color: var(--muted); flex: none; }

.loy-card.completa { border-color: var(--gold); box-shadow: 0 10px 30px rgba(217, 119, 6, .28); }
.loy-card.completa .cinta { background: linear-gradient(135deg, #FBBF24, var(--gold-2)); color: #3B1D00; text-align: center; font-weight: 900; padding: 8px; font-size: 1rem; letter-spacing: .02em; }
.loy-card.apagada { opacity: .7; }

/* ── Tarjeta: detalle ───────────────────────────────────────────────── */
.detalle-hero { border-radius: var(--radius); overflow: hidden; background: var(--c, var(--brand)); color: var(--ct, #fff); box-shadow: var(--shadow); }
.detalle-hero .cab { display: flex; gap: 14px; align-items: center; padding: 20px; }
.detalle-hero .cab .loy-logo { width: 64px; height: 64px; border-radius: 18px; }
.detalle-hero .cab b { font-size: 1.35rem; font-weight: 900; display: block; line-height: 1.15; }
.detalle-hero .cab span { font-weight: 700; opacity: .92; }
.detalle-hero .cuerpo { background: #fff; color: var(--ink); padding: 20px; border-radius: var(--radius) var(--radius) 0 0; }
.contador { text-align: center; margin: 4px 0 16px; }
.contador b { font-size: 2.6rem; font-weight: 900; line-height: 1; color: var(--c, var(--brand)); }
.contador span { display: block; color: var(--muted); font-weight: 800; }

.bloque { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 16px; }
.bloque h3 { margin: 0 0 10px; font-size: 1.08rem; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.bloque p { margin: 6px 0; }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lista-simple li:last-child { border-bottom: 0; }
.lista-simple .emo { font-size: 1.5rem; width: 34px; text-align: center; flex: none; }
.lista-simple small { color: var(--muted); display: block; font-weight: 700; }
.premio-item img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }

/* ── Formularios ────────────────────────────────────────────────────── */
.auth-wrap { max-width: 480px; margin: 0 auto; padding: 22px 16px 40px; }
.auth-logo { text-align: center; margin: 10px 0 18px; }
.auth-logo img { height: 64px; width: 64px; border-radius: 18px; background: #fff; padding: 8px; box-shadow: var(--shadow); }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 20px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 900; margin: 0 0 4px; text-align: center; line-height: 1.2; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 0 0 20px; font-weight: 700; }
.campo { margin-bottom: 16px; }
.campo label { display: block; font-weight: 900; margin-bottom: 6px; font-size: 1rem; }
.campo label small { font-weight: 700; color: var(--muted); }
.campo input, .campo select, .campo textarea { width: 100%; min-height: 58px; padding: 12px 16px; border: 2px solid #D5DBE6; border-radius: 14px; background: #fff; font-size: 1.1rem; outline: none; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(23, 71, 194, .15); }
.campo .ayuda { color: var(--muted); font-size: .88rem; margin-top: 6px; font-weight: 700; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 96px; }
.pass-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: #EEF2F8; border-radius: 10px; min-height: 42px; padding: 0 12px; font-weight: 900; color: var(--brand); cursor: pointer; }
.input-codigo { text-align: center; letter-spacing: .5em; font-size: 2rem !important; font-weight: 900; min-height: 74px !important; }
.links-aux { display: grid; gap: 6px; margin-top: 16px; text-align: center; font-weight: 800; }
.links-aux a { padding: 10px; text-decoration: none; }
.uniendo { display: flex; gap: 12px; align-items: center; background: var(--gold-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 18px; font-weight: 800; }
.uniendo .loy-logo { width: 46px; height: 46px; }

/* ── Navegación inferior ────────────────────────────────────────────── */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.bottom-nav .in { max-width: 560px; margin: 0 auto; height: var(--nav-h); display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: #64748B; font-weight: 800; font-size: .8rem; height: 100%; }
.bottom-nav a svg { width: 28px; height: 28px; }
.bottom-nav a.on { color: var(--brand); }
.bottom-nav a.scan .bola { width: 62px; height: 62px; margin-top: -26px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(13, 43, 115, .4); border: 4px solid #fff; }
.bottom-nav a.scan .bola svg { width: 30px; height: 30px; }
.bottom-nav a.scan { color: var(--brand); }

/* ── Escáner ────────────────────────────────────────────────────────── */
body.scan-body { background: #05091A; color: #fff; }
.scan-wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
.scan-wrap h1 { font-size: 1.45rem; text-align: center; margin: 6px 0 4px; font-weight: 900; }
.scan-wrap .sub { text-align: center; opacity: .85; margin: 0 0 16px; font-weight: 700; }
#lector { width: 100%; border-radius: 24px; overflow: hidden; background: #111827; min-height: 320px; position: relative; }
#lector video { border-radius: 24px; }
.scan-estado { text-align: center; margin: 14px 0; font-weight: 800; min-height: 28px; }
.scan-wrap .btn-light { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); }
.scan-wrap .back { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none; }

/* ── Celebración / resultado ───────────────────────────────────────── */
.resultado { text-align: center; padding-top: 10px; }
.resultado .grande { font-size: 5rem; line-height: 1; margin: 10px 0; }
.resultado h1 { font-size: 1.9rem; font-weight: 900; margin: 6px 0; line-height: 1.15; }
.resultado p.lead { font-size: 1.12rem; color: var(--muted); font-weight: 700; margin: 6px 0 18px; }
.res-item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 14px 0; text-align: left; }
.res-item .t { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 900; font-size: 1.08rem; }

/* ── Mi código ──────────────────────────────────────────────────────── */
.qr-box { background: #fff; border-radius: 28px; padding: 26px 20px; text-align: center; box-shadow: var(--shadow); }
.qr-box #qr { display: inline-block; padding: 14px; background: #fff; border-radius: 16px; border: 2px solid var(--line); }
.qr-box #qr img, .qr-box #qr canvas { width: 240px !important; height: 240px !important; }
.codigo-grande { font-size: 2.1rem; font-weight: 900; letter-spacing: .18em; margin: 16px 0 4px; color: var(--brand); font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

/* ── Modal sencillo ────────────────────────────────────────────────── */
.modal-ov { position: fixed; inset: 0; background: rgba(5, 9, 26, .6); z-index: 200; display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.modal-box { background: #fff; color: var(--ink); width: 100%; max-width: 480px; border-radius: 26px; padding: 24px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); max-height: 90vh; overflow-y: auto; animation: subir .25s ease-out; }
.modal-box h3 { margin: 0 0 8px; font-size: 1.35rem; font-weight: 900; }
@keyframes subir { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) { .modal-ov { align-items: center; } }

.vacio { text-align: center; background: #fff; border-radius: var(--radius); padding: 30px 20px; box-shadow: var(--shadow); }
.vacio .grande { font-size: 3.6rem; }
.vacio h3 { margin: 8px 0 6px; font-size: 1.3rem; font-weight: 900; }
.vacio p { color: var(--muted); font-weight: 700; margin: 0 0 18px; }
.pasos { text-align: left; margin: 0 0 18px; padding: 0; list-style: none; counter-reset: p; }
.pasos li { counter-increment: p; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; font-weight: 700; }
.pasos li::before { content: counter(p); width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; flex: none; }

.powered { text-align: center; margin: 30px 0 8px; color: #94A3B8; font-size: .78rem; font-weight: 700; }
.powered img { height: 22px; display: block; margin: 6px auto 0; opacity: .9; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.toggle-row b { display: block; }
.toggle-row small { color: var(--muted); font-weight: 700; }

/* Landing del negocio (unirse) */
.negocio-hero { background: var(--c, var(--brand)); color: var(--ct, #fff); padding: 34px 20px 70px; text-align: center; }
.negocio-hero .loy-logo { width: 96px; height: 96px; border-radius: 26px; margin: 0 auto 14px; font-size: 2.4rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.negocio-hero h1 { margin: 0; font-size: 1.9rem; font-weight: 900; line-height: 1.15; }
.negocio-hero p { margin: 8px auto 0; max-width: 420px; font-weight: 700; opacity: .95; font-size: 1.05rem; }
.negocio-cont { max-width: 560px; margin: -48px auto 0; padding: 0 16px 40px; position: relative; }
.promo-prev { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.promo-prev .t { display: flex; gap: 12px; align-items: center; }
.promo-prev .t .emo { font-size: 2.2rem; }
.promo-prev .t b { font-size: 1.15rem; display: block; font-weight: 900; }
.promo-prev .t span { color: var(--muted); font-weight: 700; font-size: .95rem; }
.promo-prev .meta { margin-top: 12px; background: var(--gold-soft); border-radius: 12px; padding: 10px 14px; font-weight: 800; color: #6B3A00; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.bloque h3 svg { width: 24px; height: 24px; color: var(--brand); }
