:root {
  --bg: #1e1009;
  --bg-lowest: #180b05;
  --surface-low: #271811;
  --surface: #2c1c15;
  --surface-high: #37261e;
  --surface-highest: #433129;
  --text: #fadcd0;
  --text-muted: #dbc1b4;
  --outline: #a38c80;
  --line: #554339;
  --olive: #5c5f38;
  --olive-hover: #4d512d;
  --olive-deep: #32361e;
  --olive-border: rgba(122, 126, 75, .45);
  --sage: #c2ca8a;
  --sage-light: #d8dfa6;
  --sage-dim: #a1a868;
  --cream: #f7f9e8;
  --terracotta: #d97736;
  --gold: #eec067;
  --ok: #9fcf7a;
  --ok-bg: #22301a;
  --err: #ffb4ab;
  --err-bg: #3d1410;
  --radius: .75rem;
  --f-head: 'Epilogue', system-ui, sans-serif;
  --f-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --f-label: 'Space Grotesk', ui-monospace, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.icon {
  font-family: 'Material Symbols Outlined';
  font-weight: normal; font-style: normal; font-size: 20px; line-height: 1;
  display: inline-block; white-space: nowrap; direction: ltr;
  -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 400;
}
.icon.fill { font-variation-settings: 'FILL' 1, 'wght' 400; }

.label {
  font: 600 12px/16px var(--f-label);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.label-sm { font: 600 10px/14px var(--f-label); letter-spacing: .14em; text-transform: uppercase; }

/* ---------- Layout ---------- */
.page { display: flex; flex-direction: column; min-height: 100vh; }
.hero {
  position: relative;
  height: 420px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 35%, rgba(217, 119, 54, .35), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(92, 95, 56, .45), transparent 60%),
    var(--bg-lowest);
}
.hero img.photo { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(30, 16, 9, .6) 45%, transparent 100%);
}
.hero-top, .hero-bottom { position: absolute; left: 16px; right: 16px; z-index: 1; }
.hero-top { top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero-bottom { bottom: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(24, 11, 5, .85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--olive-border); color: var(--sage-light);
}
.pill.solid { background: var(--olive); color: var(--cream); }
.lang-toggle { cursor: pointer; }
.lang-toggle b { color: var(--cream); }
.lang-toggle span { opacity: .55; }

.wordmark { display: inline-block; }
.wordmark strong { display: block; font: 700 30px/1 var(--f-head); letter-spacing: .32em; color: var(--cream); text-shadow: 0 2px 16px rgba(0, 0, 0, .8); }
.wordmark img { height: 72px; width: auto; filter: drop-shadow(0 2px 14px rgba(0, 0, 0, .75)); }
.pill-iso { width: 18px; height: 18px; object-fit: contain; }
.tagline { margin-top: 6px; color: var(--sage-light); text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }

.content { display: flex; flex-direction: column; gap: 24px; padding: 16px 20px 32px; }

/* ---------- Tipografía ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--sage); }
.eyebrow .icon { color: var(--sage-dim); }
h1, h2, h3 { font-family: var(--f-head); margin: 0; color: var(--text); }
h1 { font-size: 28px; line-height: 1.2; font-weight: 700; margin-top: 4px; }
h3 { font-size: 22px; line-height: 1.3; font-weight: 700; color: var(--cream); }
.lead { color: var(--text-muted); margin: 6px 0 0; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface-low); border-radius: var(--radius); padding: 24px; box-shadow: 0 16px 36px -8px rgba(10, 5, 3, .7); }
.dessert { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--surface); }
.dessert-icon {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: .5rem;
  background: var(--olive-deep); border: 1px solid var(--olive-border);
  display: grid; place-items: center; color: var(--sage);
}
.dessert-icon .icon { font-size: 28px; }
.dessert .label-sm { color: var(--sage-dim); }
.dessert-name { font: 600 19px/1.3 var(--f-head); color: #f0e8cb; }
.dessert-desc { font-size: 13px; color: var(--text-muted); }

/* ---------- Formularios ---------- */
form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { display: flex; align-items: center; gap: 4px; color: var(--text-muted); }
.field > label .icon { font-size: 16px; }
.input {
  width: 100%; min-width: 0;
  background: var(--surface-high); color: var(--text);
  border: 1px solid transparent; border-radius: .5rem;
  padding: 12px 16px; font-size: 16px; /* 16px evita el zoom automático en iOS */
  outline: none; transition: background .15s, border-color .15s;
}
.input::placeholder { color: var(--outline); }
.input:focus { background: var(--surface-highest); border-color: var(--olive-border); }
.input[aria-invalid="true"] { border-color: var(--err); }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.select-wrap .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--outline); }
.phone-row { display: flex; gap: 8px; }
.phone-row .cc { width: 88px; flex-shrink: 0; text-align: center; font-family: var(--f-label); }
.error { color: var(--err); font-size: 13px; }
.optional { margin-left: 4px; color: var(--outline); text-transform: none; letter-spacing: 0; font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--olive); flex-shrink: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* Oculto a la vista pero usable (Safari no abre selectores de archivo con display:none) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }

/* ---------- Botones ---------- */
.btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: .5rem; cursor: pointer;
  background: var(--olive); color: var(--cream);
  border: 1px solid var(--olive-border);
  font: 600 19px/1.3 var(--f-head);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .5);
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { background: var(--olive-hover); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.small { font-size: 16px; padding: 12px 18px; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line); color: var(--text-muted); font: 600 14px/1.3 var(--f-label); }
.btn.ghost:hover { color: var(--text); background: var(--surface); }
.btn.terracotta { background: var(--terracotta); border-color: rgba(238, 192, 103, .4); }
.btn.terracotta:hover { background: #c4682b; }
.btn-row { display: flex; flex-direction: column; gap: 8px; }
.btn-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-duo .btn { padding: 12px 10px; }
.btn.wa .icon { color: #25d366; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(247, 249, 232, .35); border-top-color: var(--cream); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Voucher ---------- */
.success-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.badge-circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--olive-deep); border: 2px solid var(--olive);
  display: grid; place-items: center; color: var(--sage);
}
.badge-circle .icon { font-size: 34px; }
.success-head .label-sm { color: var(--sage-dim); }
.success-head p { margin: 0; color: var(--text-muted); }
.voucher { background: var(--surface-highest); border: 1px solid rgba(92, 95, 56, .35); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.voucher-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.voucher-top .label-sm { color: var(--outline); }
.folio { display: block; font: 700 22px/1.2 var(--f-label); color: var(--sage); letter-spacing: .06em; }
.voucher-name { font: 600 19px/1.3 var(--f-head); margin-top: 10px; overflow-wrap: anywhere; }
.voucher-phone { font: 400 13px/1.4 var(--f-label); color: var(--text-muted); }
.qr-plate {
  margin: 16px auto 4px; background: var(--cream); border-radius: 1rem; padding: 14px;
  width: min(100%, 260px); box-shadow: 0 8px 24px -4px rgba(217, 119, 54, .25);
}
.qr-plate canvas { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.scan-pill { display: table; margin: 10px auto 0; background: var(--terracotta); color: var(--cream); padding: 4px 14px; border-radius: 999px; }
.voucher-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; color: var(--sage); font-size: 13px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: .5rem; background: var(--surface-low); border: 1px solid rgba(92, 95, 56, .2); color: var(--text-muted); font-size: 13px; margin-top: 16px; }
.note .icon { color: var(--sage-dim); flex-shrink: 0; }
.note.warn { border-color: rgba(238, 192, 103, .35); }
.note.warn .icon { color: var(--gold); }

.terms { font-size: 12px; color: var(--outline); line-height: 1.6; margin: 0; padding-left: 18px; }
.terms li + li { margin-top: 2px; }

/* ---------- Contacto ---------- */
.contact { background: var(--bg-lowest); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.contact > .label-sm { text-align: center; color: var(--outline); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.contact a, .contact .item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: .5rem; background: var(--surface-low); color: var(--text); text-decoration: none; min-width: 0; }
.contact a:active { background: var(--surface-highest); }
.contact .circle { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: var(--olive-deep); border: 1px solid var(--olive-border); display: grid; place-items: center; color: var(--sage); }
.contact .txt { display: flex; flex-direction: column; min-width: 0; }
.contact .txt small { font: 500 10px/14px var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--outline); }
.contact .txt span { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }

/* ---------- Correo: sugerencia de corrección ---------- */
.suggest {
  align-self: flex-start; background: none; border: 0; padding: 2px 0; cursor: pointer; text-align: left;
  color: var(--gold); font: 600 13px/1.4 var(--f-body); text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Último paso: WhatsApp ---------- */
.final-step {
  margin-top: 16px; padding: 16px; border-radius: var(--radius);
  background: rgba(26, 158, 80, .12); border: 1px solid rgba(37, 211, 102, .45);
  display: flex; flex-direction: column; gap: 12px;
}
.final-step p { margin: 0; font-size: 14px; color: var(--text); }
.btn.wa-solid { background: #1a9e50; border-color: rgba(255, 255, 255, .18); color: #fff; }
.btn.wa-solid:hover { background: #168a45; }
.final-done { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--ok); text-align: center; }
.final-done a { color: var(--sage); }
.qr-plate { position: relative; }
.qr-plate.locked canvas { filter: blur(9px); opacity: .45; }
.qr-lock {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 18px; text-align: center; color: #1e1009; font: 700 14px/1.35 var(--f-label);
}
.qr-lock .icon { font-size: 40px; }

/* ---------- Botón flotante (solo celular) ---------- */
.float-cta {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 20px; border-radius: 999px;
  background: var(--terracotta); color: var(--cream); text-decoration: none;
  font: 600 18px/1.2 var(--f-head);
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, .75), 0 0 0 1px rgba(238, 192, 103, .4);
  transition: transform .3s ease, opacity .3s ease;
}
.float-cta:active { transform: scale(.97); }
.float-cta .icon:last-child { animation: nudge 1.6s ease-in-out infinite; }
.float-cta.hide { transform: translateY(160%); opacity: 0; pointer-events: none; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (max-width: 959px) { .content { padding-bottom: 96px; } } /* que el botón no tape el final */
@media (min-width: 960px) { .float-cta { display: none; } }
@media (prefers-reduced-motion: reduce) { .float-cta .icon:last-child { animation: none; } }

.demo-banner { background: var(--gold); color: #261900; text-align: center; font: 600 12px/1.4 var(--f-label); padding: 6px 12px; }

.fade-in { animation: fadeIn .35s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Escritorio ---------- */
@media (min-width: 960px) {
  .page.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(460px, 560px); min-height: 100vh; }
  .page.split .hero { position: sticky; top: 0; height: 100vh; }
  .page.split .hero::after { background: linear-gradient(to top, rgba(30, 16, 9, .95) 0%, rgba(30, 16, 9, .35) 50%, rgba(30, 16, 9, .15) 100%); }
  .page.split .hero-top, .page.split .hero-bottom { left: 48px; right: 48px; }
  .page.split .hero-top { top: 40px; }
  .page.split .hero-bottom { bottom: 48px; }
  .page.split .wordmark strong { font-size: 44px; }
  .page.split .wordmark img { height: 112px; }
  .page.split .content { padding: 56px 48px; justify-content: center; }
  h1 { font-size: 34px; }
}
