/* ==========================================================
   Sant Paul · Área de cliente
   ========================================================== */
:root {
  --espresso: #1f140e;
  --coffee: #2c1c13;
  --brown: #5b3a29;
  --caramel: #c68a4e;
  --caramel-soft: #e4b988;
  --cream: #f7efe4;
  --paper: #fbf7f1;
  --white: #fff;
  --green: #2f7a3a;
  --green-soft: #e3f1e4;
  --red: #b83a2e;
  --red-soft: #fbe6e3;
  --ink: #2a1d15;
  --muted: #7a6558;
  --line: rgba(59, 37, 25, .12);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 40px -22px rgba(31, 20, 14, .45);
  --shadow-sm: 0 6px 18px -10px rgba(31, 20, 14, .35);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --f-display: "Fraunces", Georgia, serif;
  --f-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabbar-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: var(--f-body); font-size: 1rem; line-height: 1.55; color: var(--ink); background: var(--paper); }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
.ic { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--caramel); margin: 0 0 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- Botones ---------- */
.btn {
  --bg: var(--caramel); --fg: var(--espresso);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 12px 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--bg); color: var(--fg); text-decoration: none;
  font: 700 .95rem/1.1 var(--f-body);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), opacity .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .ic { width: 20px; height: 20px; }
.btn--dark { --bg: var(--espresso); --fg: var(--cream); }
.btn--ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--caramel); }
.btn--light { --bg: rgba(255,255,255,.12); --fg: #fff; }
.btn--green { --bg: var(--green); --fg: #fff; }
.btn--danger { --bg: var(--red-soft); --fg: var(--red); }
.btn--block { width: 100%; }
.btn--lg { min-height: 58px; font-size: 1.05rem; }
.btn--sm { min-height: 40px; padding: 8px 16px; font-size: .85rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brown); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.is-loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 700; font-size: .9rem; }
.input-wrap { position: relative; }
.input-wrap > .ic { position: absolute; left: 16px; top: 50%; translate: 0 -50%; color: var(--muted); width: 20px; height: 20px; pointer-events: none; }
.input {
  width: 100%; min-height: 54px; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--white); color: var(--ink);
  font: 500 1rem var(--f-body); transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
.input-wrap > .ic + .input { padding-left: 48px; }
.input:focus { outline: 0; border-color: var(--caramel); box-shadow: 0 0 0 4px rgba(198,138,78,.18); }
.input.is-invalid { border-color: var(--red); }
.input--big { min-height: 76px; font-family: var(--f-display); font-size: 2.2rem; text-align: center; letter-spacing: .02em; }
.input--code { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; text-align: center; }
.field-error { color: var(--red); font-size: .85rem; font-weight: 500; }
.hint { color: var(--muted); font-size: .85rem; }
.pass-toggle { position: absolute; right: 8px; top: 50%; translate: 0 -50%; background: none; border: 0; padding: 10px; color: var(--muted); cursor: pointer; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--caramel); flex: none; margin: 1px 0 0; }
.switch-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--white); cursor: pointer; transition: border-color .2s, background .2s; }
.switch-card:has(input:checked) { border-color: var(--caramel); background: #fff8f0; }
.switch-card input { width: 22px; height: 22px; accent-color: var(--caramel); flex: none; }
.switch-card strong { display: block; }
.switch-card small { color: var(--muted); }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); font-size: .95rem; }
.alert .ic { margin-top: 1px; }
.alert--error { background: var(--red-soft); color: #7d241b; }
.alert--ok { background: var(--green-soft); color: #1e5226; }
.alert--info { background: var(--cream); color: var(--brown); }

/* ---------- Pantallas de acceso ---------- */
.auth-wrap { min-height: 100svh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-visual { position: relative; overflow: hidden; background: var(--espresso); color: #fff; display: flex; align-items: flex-end; padding: 56px; }
.auth-visual__img { position: absolute; inset: 0; background: url("img/hero.webp") center/cover; animation: slowZoom 20s ease-in-out infinite alternate; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20,12,8,.9), rgba(20,12,8,.1) 60%); }
.auth-visual__text { position: relative; z-index: 1; max-width: 440px; }
.auth-visual h2 { font-size: clamp(2.4rem, 4vw, 3.6rem); font-weight: 400; }
.auth-visual h2 em { color: var(--caramel-soft); }
.auth-visual p { color: rgba(247,239,228,.8); }
@keyframes slowZoom { to { transform: scale(1.1); } }
.auth-main { display: flex; flex-direction: column; justify-content: center; width: min(460px, 100% - 32px); margin: 0 auto; padding: 48px 0; }
.auth-logo img { width: 84px; height: auto; margin: 0 auto 24px; }
.auth-main h1 { font-size: 2.1rem; text-align: center; }
.auth-main .lead { text-align: center; color: var(--muted); margin-bottom: 28px; }
.auth-alt { text-align: center; margin-top: 22px; color: var(--muted); }
.auth-alt a { color: var(--brown); font-weight: 700; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin: 34px auto 0; color: var(--muted); text-decoration: none; font-size: .9rem; }
.auth-back .ic { width: 18px; height: 18px; }
/* ---------- "Solo desde la app" ---------- */
.app-gate { display: none; }
.need-app .app-gate { display: flex; min-height: 100svh; align-items: center; justify-content: center; padding: 32px 16px; background: radial-gradient(120% 80% at 50% 0%, #fff4e6, var(--paper) 60%); }
.need-app .app-shell, .need-app .tabbar, .need-app .auth-wrap { display: none !important; }
.app-gate__box { width: min(440px, 100%); text-align: center; animation: rise .8s var(--ease) both; }
.app-gate__logo { width: 96px; height: auto; margin: 0 auto 18px; }
.app-gate h1 { font-size: clamp(1.8rem, 6vw, 2.3rem); }
.app-gate__text { color: var(--muted); margin-bottom: 24px; }
.app-gate__hint { font-size: .88rem; color: var(--muted); margin: 14px 0 0; }
.app-gate__staff { display: inline-block; margin-top: 26px; font-size: .8rem; color: var(--muted); }

.legal-links { text-align: center; font-size: .8rem; color: var(--muted); margin: 14px 0 0; }
.legal-links a { color: var(--muted); }
.danger-zone { border-color: #f1c9c3; }
.danger-zone h3 { color: var(--red); }
.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .85rem; margin: 26px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Estructura de la app ---------- */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100svh; }
.app-side { position: sticky; top: 0; height: 100svh; background: var(--espresso); color: var(--cream); display: flex; flex-direction: column; padding: 26px 18px; }
.app-side__brand img { width: 64px; height: auto; margin: 0 0 30px 10px; }
.app-side__nav { display: grid; gap: 4px; }
.app-side__nav a { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 14px; text-decoration: none; color: rgba(247,239,228,.75); font-weight: 500; transition: background .25s, color .25s; }
.app-side__nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-side__nav a.is-active { background: var(--caramel); color: var(--espresso); font-weight: 700; }
.app-side__admin { margin-top: 18px; border: 1px dashed rgba(228,185,136,.4); }
.app-side__site { margin-top: auto; display: flex; align-items: center; gap: 8px; color: rgba(247,239,228,.6); text-decoration: none; font-size: .9rem; padding: 10px 14px; }
.app-main { min-width: 0; }
.app-top { display: flex; align-items: center; gap: 14px; padding: 22px clamp(16px, 4vw, 48px) 8px; }
.app-top__logo { display: none; }
.app-top__logo img { width: 44px; height: auto; }
.app-top__hello { flex: 1; line-height: 1.2; }
.app-top__hello small { display: block; color: var(--muted); font-size: .85rem; }
.app-top__hello strong { font-family: var(--f-display); font-size: 1.5rem; font-weight: 500; }
.app-top__avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--caramel); color: var(--espresso); display: grid; place-items: center; font-weight: 700; text-decoration: none; }
.app-content { padding: 14px clamp(16px, 4vw, 48px) 60px; max-width: 980px; }
.tabbar { display: none; }

.page-title { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 6px; }
.page-sub { color: var(--muted); margin-bottom: 24px; }
.section-gap { margin-top: 34px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 1.35rem; margin: 0; }

/* ---------- Tarjetas ---------- */
.card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 0 var(--line); border: 1px solid var(--line); }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 1.2rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Tarjeta de fidelización */
.lcard {
  position: relative; overflow: hidden; border-radius: 26px; padding: 26px; color: var(--cream);
  background: radial-gradient(120% 140% at 100% 0%, #6b4430 0%, var(--coffee) 45%, var(--espresso) 100%);
  box-shadow: var(--shadow); isolation: isolate;
}
.lcard + .lcard { margin-top: 18px; }
.lcard::before { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -90px; border-radius: 50%; border: 36px solid rgba(228,185,136,.08); z-index: -1; }
.lcard::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M20 60c0-11 9-20 20-20s20 9 20 20' fill='none' stroke='%23e4b988' stroke-opacity='.05' stroke-width='2'/%3E%3C/svg%3E"); z-index: -1; }
.lcard__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.lcard__name { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--caramel-soft); font-weight: 700; }
.lcard__rule { font-size: .82rem; color: rgba(247,239,228,.6); }
.lcard__body { display: flex; align-items: center; gap: 22px; }
.ring { --p: 0; --size: 124px; position: relative; width: var(--size); height: var(--size); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .ring__bg { stroke: rgba(255,255,255,.1); }
.ring .ring__fg { stroke: var(--caramel); stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset 1.6s var(--ease); }
.ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring__label strong { font-family: var(--f-display); font-size: 2.3rem; font-weight: 500; color: #fff; }
.ring__label small { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(247,239,228,.6); margin-top: 4px; }
.lcard__next { flex: 1; min-width: 0; }
.lcard__next small { color: rgba(247,239,228,.6); font-size: .82rem; }
.lcard__next strong { display: block; font-family: var(--f-display); font-size: 1.35rem; font-weight: 500; color: #fff; margin: 2px 0 8px; }
.lcard__next p { color: rgba(247,239,228,.75); font-size: .92rem; margin: 0; }
.lcard__next .pill { margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: rgba(255,255,255,.1); color: var(--caramel-soft); }
.pill .ic { width: 15px; height: 15px; }
.pill--ok { background: var(--green-soft); color: var(--green); }
.pill--warn { background: #fff1dc; color: #8a5a12; }
.pill--muted { background: var(--cream); color: var(--muted); }
.pill--red { background: var(--red-soft); color: var(--red); }

/* Escalera de premios */
.ladder { display: flex; gap: 8px; margin-top: 22px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.ladder::-webkit-scrollbar { display: none; }
.ladder__step { flex: 1 0 120px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.ladder__step small { display: block; color: rgba(247,239,228,.55); font-size: .75rem; }
.ladder__step strong { font-size: .9rem; font-weight: 700; }
.ladder__step.is-done { background: rgba(198,138,78,.2); border-color: rgba(228,185,136,.45); }
.ladder__step.is-done small { color: var(--caramel-soft); }
.ladder__step.is-max strong::after { content: " 🏆"; }
.lcard__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Accesos rápidos */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.quick a { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; border-radius: 18px; background: var(--white); border: 1px solid var(--line); text-decoration: none; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.quick a:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.quick__ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--cream); color: var(--brown); }
.quick strong { font-size: .95rem; }
.quick small { color: var(--muted); font-size: .8rem; margin-top: -8px; }

/* Historial */
.tx-list { display: grid; }
.tx { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: 0; }
.tx__ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--cream); color: var(--brown); flex: none; }
.tx__ic .ic { width: 20px; height: 20px; }
.tx__ic--minus { background: var(--red-soft); color: var(--red); }
.tx__ic--plus { background: var(--green-soft); color: var(--green); }
.tx__main { flex: 1; min-width: 0; }
.tx__main strong { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx__main small { color: var(--muted); font-size: .82rem; }
.tx__val { font-weight: 700; white-space: nowrap; }
.tx__val--minus { color: var(--red); }
.tx__val--plus { color: var(--green); }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .ic { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--caramel); }
.tabs-seg { display: inline-flex; background: var(--cream); padding: 4px; border-radius: 999px; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs-seg button { border: 0; background: none; padding: 8px 16px; border-radius: 999px; font: 700 .85rem var(--f-body); color: var(--muted); cursor: pointer; }
.tabs-seg button.is-active { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Hucha ---------- */
.wallet-hero { position: relative; overflow: hidden; border-radius: 26px; padding: 28px; color: #fff; background: linear-gradient(135deg, #2d5a31, #1c3b20); box-shadow: var(--shadow); }
.wallet-hero::after { content: ""; position: absolute; width: 240px; height: 240px; right: -70px; bottom: -110px; border-radius: 50%; background: rgba(255,255,255,.07); }
.wallet-hero small { color: rgba(255,255,255,.7); letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; font-weight: 700; }
.wallet-hero__balance { font-family: var(--f-display); font-size: clamp(2.8rem, 9vw, 3.8rem); line-height: 1.05; margin: 6px 0 12px; }
.wallet-hero .pill { background: rgba(255,255,255,.14); color: #fff; }
.topup-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.topup-btn { border: 1.5px solid var(--line); background: var(--white); border-radius: 16px; padding: 18px 8px; font: 700 1.25rem var(--f-display); color: var(--ink); cursor: pointer; transition: transform .3s var(--ease), border-color .2s, background .2s; }
.topup-btn small { display: block; font: 500 .75rem var(--f-body); color: var(--muted); margin-top: 2px; }
.topup-btn:hover { transform: translateY(-3px); border-color: var(--caramel); background: #fff8f0; }
.gift-code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: clamp(2rem, 8vw, 2.8rem); letter-spacing: .22em; font-weight: 700; text-align: center; padding: 18px; border-radius: 18px; background: var(--cream); color: var(--espresso); border: 2px dashed var(--caramel); margin: 12px 0; }
.code-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.code-row:last-child { border-bottom: 0; }
.code-row code { font-weight: 700; letter-spacing: .12em; font-size: 1rem; background: var(--cream); padding: 6px 10px; border-radius: 8px; }
.code-row__main { flex: 1; min-width: 0; font-size: .88rem; }
.code-row__main small { display: block; color: var(--muted); }

/* ---------- Canjear (cargar ticket) ---------- */
.scan-page { max-width: 520px; margin: 0 auto; }
.scan-hero { text-align: center; padding: 10px 0 18px; }
.scan-hero .pill { background: var(--cream); color: var(--brown); }
.scan-hero h1 { font-size: 2rem; margin: 12px 0 6px; }
.points-now { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.points-now strong { font-family: var(--f-display); font-size: 1.6rem; color: var(--ink); }
.calc-preview { text-align: center; color: var(--muted); font-size: .92rem; min-height: 1.4em; }
.calc-preview strong { color: var(--green); }
.geo-status { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); justify-content: center; min-height: 1.4em; }
.geo-status.is-ok { color: var(--green); }
.geo-status.is-error { color: var(--red); }
.state-card { text-align: center; padding: 36px 24px; }
.state-card .big-ic { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: var(--cream); color: var(--brown); }
.state-card .big-ic .ic { width: 36px; height: 36px; }
.countdown { font-family: var(--f-display); font-size: 2.2rem; margin: 6px 0 14px; }

/* ---------- Escáner ---------- */
.scanner { position: relative; aspect-ratio: 1; max-width: 420px; margin: 0 auto; border-radius: 28px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner__frame { position: absolute; inset: 16%; border-radius: 22px; box-shadow: 0 0 0 999px rgba(0,0,0,.45); }
.scanner__frame::before, .scanner__frame::after { content: ""; position: absolute; inset: -3px; border-radius: 24px; border: 4px solid var(--caramel); clip-path: polygon(0 0, 25% 0, 25% 4px, 4px 4px, 4px 25%, 0 25%, 0 75%, 4px 75%, 4px calc(100% - 4px), 25% calc(100% - 4px), 25% 100%, 75% 100%, 75% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 75%, 100% 75%, 100% 25%, calc(100% - 4px) 25%, calc(100% - 4px) 4px, 75% 4px, 75% 0, 100% 0, 100% 100%, 0 100%); }
.scanner__frame::after { border: 0; clip-path: none; height: 2px; inset: auto 8% auto 8%; top: 10%; background: linear-gradient(90deg, transparent, var(--caramel-soft), transparent); animation: scanline 2.2s ease-in-out infinite; }
@keyframes scanline { 50% { top: 88%; } }
.scanner__msg { position: absolute; left: 16px; right: 16px; bottom: 16px; text-align: center; color: #fff; font-size: .9rem; background: rgba(0,0,0,.5); padding: 10px; border-radius: 12px; backdrop-filter: blur(6px); }
.scanner.is-found .scanner__frame::before { border-color: #4ade80; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 200; left: 50%; top: 18px; translate: -50% 0; display: grid; gap: 8px; width: min(440px, 100% - 32px); }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 16px; background: var(--espresso); color: #fff; box-shadow: var(--shadow); animation: toastIn .5s var(--ease); font-weight: 500; }
.toast--success .ic { color: #4ade80; }
.toast--error { background: #7d241b; }
.toast.is-leaving { animation: toastOut .4s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-16px); } }

/* ---------- Hoja modal (celebración / confirmaciones) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(20,12,8,.6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .3s; }
.sheet { width: min(460px, 100%); max-height: 90svh; overflow: auto; background: var(--white); border-radius: 28px; padding: 30px 24px 24px; text-align: center; box-shadow: var(--shadow); animation: pop .6s var(--ease); position: relative; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(40px) scale(.94); } }
.sheet__burst { width: 92px; height: 92px; margin: -6px auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 2.8rem; line-height: 1; background: radial-gradient(circle, #fff3e2, #f4d6b1); color: var(--brown); animation: burst 1s var(--ease); }
.sheet__burst .ic { width: 44px; height: 44px; }
@keyframes burst { 0% { transform: scale(.3) rotate(-30deg); } 60% { transform: scale(1.1) rotate(6deg); } }
.sheet h2 { font-size: 1.8rem; }
.sheet__points { font-family: var(--f-display); font-size: 3.6rem; line-height: 1; color: var(--caramel); margin: 4px 0; }
.sheet__reward { margin: 18px 0 6px; padding: 18px; border-radius: 18px; background: linear-gradient(135deg, #fff5e8, #fbe3c4); text-align: left; }
.sheet__reward.is-max { background: linear-gradient(135deg, #fdf0cf, #f3cf85); }
.sheet__reward p { margin: 6px 0 0; }
.sheet__actions { display: grid; gap: 10px; margin-top: 18px; }
.sheet__pay { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--green-soft); color: #1e5226; font-size: .92rem; }
.sheet__count { margin-top: 14px; font-size: .85rem; color: var(--muted); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 160; }

/* ---------- Instalar app ---------- */
.install-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: var(--cream); margin-top: 18px; }
.install-card .ic { width: 30px; height: 30px; color: var(--brown); }
.install-card div { flex: 1; font-size: .9rem; }
.install-card strong { display: block; }

/* ---------- Aparición ---------- */
.fx { animation: rise .8s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-side { display: none; }
  .app-top { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .app-top__logo { display: block; }
  .app-content { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 30px); }
  .tabbar {
    display: flex; position: fixed; z-index: 100; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b));
    height: 66px; align-items: center; justify-content: space-around; padding: 0 6px;
    background: rgba(31,20,14,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-radius: 24px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.5);
  }
  .tabbar__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: rgba(247,239,228,.6); text-decoration: none; font-size: .68rem; font-weight: 700; padding: 6px 0; transition: color .25s; }
  .tabbar__item .ic { width: 23px; height: 23px; }
  .tabbar__item.is-active { color: var(--caramel-soft); }
  .tabbar__item--scan .tabbar__icon { width: 60px; height: 60px; margin-top: -34px; border-radius: 50%; display: grid; place-items: center; background: var(--caramel); color: var(--espresso); box-shadow: 0 10px 24px -6px rgba(198,138,78,.8), 0 0 0 6px var(--paper); transition: transform .3s var(--ease); }
  .tabbar__item--scan:active .tabbar__icon { transform: scale(.92); }
  .tabbar__item--scan .ic { width: 28px; height: 28px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 560px) {
  .lcard { padding: 22px 18px; }
  .lcard__body { gap: 16px; }
  .ring { --size: 106px; }
  .ring__label strong { font-size: 1.9rem; }
  .quick { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .quick a { padding: 14px 12px; }
  .quick small { display: none; }
  .topup-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 20px 18px; }
}
