/* Amigo Invisible — estilo clean (prototipo v4) */
:root {
  --bg: #FAFAF8; --surface: #FFFFFF; --sunken: #F2F2EF;
  --ink: #18181A; --muted: #616166; --line: #E5E5E1;
  --red: #C4202F; --on-red: #FFFFFF; --red-soft: #FCECEC;
  --pine: #22543F; --on-pine: #FFFFFF; --pine-soft: #E7F1EC;
  --gold: #F2B33D; --gold-soft: #FDF3DF; --gold-ink: #7A5310;
  --wa: #1E8E4E;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214; --surface: #1B1B1E; --sunken: #26262A;
    --ink: #F4F4F1; --muted: #A8A8AD; --line: #2E2E33;
    --red: #FF5A5F; --on-red: #1A0A0B; --red-soft: #3A1C1F;
    --pine: #6ACF9F; --on-pine: #0E2219; --pine-soft: #1A3329;
    --gold-soft: #3A2F18; --gold-ink: #F2B33D;
    --wa: #25D366;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 19px/1.45 "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif; }
.display, h1, h2, h3 { font-family: "Bricolage Grotesque", "Figtree", system-ui, sans-serif; font-weight: 700; letter-spacing: -0.025em; }
h1 { font-size: 32px; line-height: 1.05; margin: 0; }
h2 { font-size: 26px; line-height: 1.1; margin: 0; }
h3 { font-size: 21px; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
svg.ic { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

/* Estructura */
.page { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 4; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 18px 12px; }
.appbar .logo { width: 40px; height: 40px; border-radius: 12px; background: var(--red); color: var(--on-red); display: grid; place-items: center; flex: none; }
.appbar .t { flex: 1; min-width: 0; line-height: 1.15; }
.appbar .t b { display: block; font: 700 19px "Bricolage Grotesque", sans-serif; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .t small { font-size: 15px; color: var(--muted); font-weight: 600; }
.iconbtn { width: 44px; height: 44px; border-radius: 13px; background: var(--sunken); display: grid; place-items: center; flex: none; border: 0; cursor: pointer; color: var(--ink); text-decoration: none; }
main { flex: 1; padding: 6px 18px 28px; display: flex; flex-direction: column; gap: 18px; }
.with-tabs main { padding-bottom: 110px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.pad { padding: 18px; }
.list > * + * { border-top: 1px solid var(--line); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--sunken); color: var(--ink); white-space: nowrap; }
.chip svg { width: 16px; height: 16px; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.pine { background: var(--pine-soft); color: var(--pine); }
.chip.gold { background: var(--gold-soft); color: var(--gold-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; padding: 0 18px; border-radius: 16px; border: 0; cursor: pointer; font-weight: 700; font-size: 19px; background: var(--red); color: var(--on-red); text-decoration: none; text-align: center; line-height: 1.2; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.pine { background: var(--pine); color: var(--on-pine); }
.btn.ink { background: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.soft { background: var(--sunken); color: var(--ink); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.danger { background: transparent; color: var(--red); border: 1.5px solid var(--red-soft); }
.btn.sm { width: auto; min-height: 48px; padding: 0 16px; font-size: 17px; border-radius: 13px; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 700; font-size: 17px; }
.field > small { font-size: 15px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 56px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); padding: 12px 16px; font-size: 19px; }
textarea.input { min-height: 140px; resize: vertical; line-height: 1.4; }
.input:focus { border-color: var(--ink); outline: none; }
.check-row { display: flex; align-items: center; gap: 12px; font-weight: 600; min-height: 48px; }
.check-row input { width: 26px; height: 26px; accent-color: var(--red); }
.error { background: var(--red-soft); color: var(--red); border-radius: 14px; padding: 12px 14px; font-weight: 600; font-size: 17px; }
.error:empty { display: none; }

/* Inicio */
.hero { background: var(--red); color: var(--on-red); border-radius: 26px; padding: 22px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.hero .tree { position: absolute; right: -14px; bottom: -16px; width: 130px; height: 130px; opacity: .15; }
.hero p { font-size: 19px; max-width: 32ch; }
.group-link { display: flex; align-items: center; gap: 14px; padding: 16px; text-decoration: none; }
.group-link .gi { width: 48px; height: 48px; border-radius: 14px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; flex: none; }

/* Regalo con lazo */
.gift-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 26px 18px; position: relative; overflow: hidden; }
.box { width: 200px; height: 200px; border-radius: 36px; background: var(--red); position: relative; cursor: pointer; box-shadow: 0 14px 30px rgba(196,32,47,.25); transition: transform .2s; border: 0; padding: 0; }
.box:hover { transform: rotate(-3deg); }
.box .rib-v, .box .rib-h { position: absolute; background: var(--gold); transition: transform .5s cubic-bezier(.6,-0.3,.4,1.4), opacity .4s; }
.box .rib-v { width: 32px; top: 0; bottom: 0; left: 84px; }
.box .rib-h { height: 32px; left: 0; right: 0; top: 84px; }
.box .knot { position: absolute; left: 66px; top: 66px; width: 68px; height: 68px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; color: #7A2A10; transition: transform .45s, opacity .35s; }
.box .knot svg { width: 32px; height: 32px; }
.tap-tag { margin-top: -32px; position: relative; background: var(--gold); color: #3A2508; font-weight: 700; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; }
.opening .rib-v { transform: translateY(-120%); opacity: 0; }
.opening .rib-h { transform: translateX(120%); opacity: 0; }
.opening .knot { transform: scale(0) rotate(90deg); opacity: 0; }
.result { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.result .name { font-size: clamp(44px, 14vw, 64px); line-height: 1; color: var(--red); overflow-wrap: anywhere; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 13px; border-radius: 2px; animation: fall 1.7s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) {
  .result, .confetti i, .box .rib-v, .box .rib-h, .box .knot { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}

/* La cena */
.count { display: flex; align-items: baseline; gap: 10px; }
.count b { font-size: 80px; line-height: .9; color: var(--red); }
.fact { display: flex; gap: 14px; align-items: center; padding: 15px 16px; }
.fact svg { color: var(--muted); }
.fact small { display: block; font-size: 15px; color: var(--muted); }
.rules { white-space: pre-wrap; font-size: 18px; line-height: 1.5; }
.quote { border-left: 4px solid var(--gold); padding: 4px 0 4px 14px; font-size: 19px; }

/* Organizador */
.bar { height: 10px; background: var(--sunken); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--pine); border-radius: 999px; transition: width .4s; }
.note { display: flex; gap: 12px; align-items: flex-start; background: var(--pine-soft); border-radius: 18px; padding: 14px 16px; font-size: 17px; }
.note svg { color: var(--pine); margin-top: 2px; }
.note.gold { background: var(--gold-soft); }
.note.gold svg { color: var(--gold-ink); }
.person { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.person .top { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; background: var(--gold-soft); color: var(--ink); flex: none; }
.person .who { flex: 1; min-width: 0; line-height: 1.25; }
.person .who b { font-size: 19px; overflow-wrap: anywhere; }
.person .who small { display: block; font-size: 15px; color: var(--muted); margin-top: 2px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line); margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: var(--pine); }
.dot.sent { background: var(--gold); }
.person details > summary { list-style: none; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.person details > summary::-webkit-details-marker { display: none; }
.person details[open] > summary { color: var(--ink); }
.person .editor { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
details.section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 18px; font-weight: 700; font-size: 19px; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after { content: "+"; font-size: 26px; color: var(--muted); }
details.section[open] > summary::after { content: "–"; }
details.section .body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.sticky-cta { position: sticky; bottom: 0; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.with-tabs .sticky-cta { bottom: var(--alto-tabbar, 80px); padding-bottom: 12px; }

/* Barra inferior */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 6px max(12px, env(safe-area-inset-bottom)); }
.tabbar .inner { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; max-width: 560px; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 14px; font-weight: 700; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 2px 0; }
.tabbar button[aria-current="page"] { color: var(--red); }
.tabbar .pill { padding: 4px 20px; border-radius: 999px; display: grid; place-items: center; }
.tabbar button[aria-current="page"] .pill { background: var(--red-soft); }
.tabbar svg { width: 26px; height: 26px; }

/* Aviso flotante */
#toast { position: fixed; left: 50%; bottom: 120px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 17px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; width: max-content; max-width: calc(100% - 32px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--red); animation: spin 0.8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Landing ===== */
.landing { max-width: 1040px; margin: 0 auto; }
.landing main { gap: 44px; padding-bottom: 40px; }
.l-hero { display: grid; gap: 28px; align-items: center; padding-top: 8px; }
.l-hero-text { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.l-hero-text .stack { width: 100%; }
.l-title { font-size: clamp(38px, 9vw, 60px); line-height: 1.02; }
.l-lead { font-size: 20px; color: var(--muted); max-width: 34ch; }
.l-h2 { font-size: clamp(28px, 6vw, 38px); line-height: 1.08; margin-top: 4px; }
.l-section { display: flex; flex-direction: column; gap: 8px; }
.demo-gift { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 36px 20px; min-height: 330px; box-shadow: var(--shadow); }
.steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.step { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.step-n { width: 48px; height: 48px; border-radius: 16px; background: var(--red); color: var(--on-red); display: grid; place-items: center; font-size: 24px; flex: none; }
.step h3 { margin-bottom: 4px; }
.l-pistas { display: flex; flex-direction: column; gap: 10px; }
.pistas-grid { display: grid; gap: 10px; margin-top: 6px; }
.pista { background: var(--sunken); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.features { display: grid; gap: 12px; margin-top: 14px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.feature-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; margin-bottom: 4px; }
.soon { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 8px; font-size: 18px; }
.faq > summary { list-style: none; cursor: pointer; padding: 18px; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; }
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary::after { content: "+"; color: var(--muted); font-size: 24px; line-height: 1; }
.faq[open] > summary::after { content: "–"; }
.faq > p { padding: 0 18px 18px; }
.l-cta { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 80px; }
.l-footer { text-align: center; color: var(--muted); font-size: 15px; padding: 24px 18px max(28px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
@media (min-width: 760px) {
  .l-hero { grid-template-columns: 1.15fr 1fr; padding-top: 32px; }
  .l-hero-text .stack { flex-direction: row; }
  .l-hero-text .stack .btn { width: auto; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { flex-direction: column; }
  .pistas-grid { grid-template-columns: 1fr 1fr; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .l-cta { max-width: 520px; margin: 0 auto; width: 100%; text-align: center; }
}
