/* LAZO · moderno, sobrio y para todo el año.
   Neutros cálidos (marfil, piedra, tinta) y un único acento color vino, usado con cuentagotas.
   Champagne suave solo en filetes finos. Sin degradados, sin sombras de adorno. */
/* tipografías servidas desde la propia app (sin Google Fonts) */
@font-face { font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/dm-serif-display-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Serif Display"; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/dm-serif-display-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin-wght-normal.woff2) format("woff2"); }

:root {
  --paper: #f7f5f0;
  --card: #fdfcf9;
  --ink: #171716;
  --muted: #6b6862;
  --line: #e2ddd3;
  --hair: #cbbfa8;           /* champagne suave, solo filetes */
  --gold-text: #7d6e55;      /* champagne legible para textos pequeños */
  --wine: #6e2633;
  --forest: #171716;         /* ya no se usa verde: alias a tinta */
  --burgundy: var(--wine);

  --accent: var(--wine);
  --primary: var(--ink);
  --on-primary: #f7f5f0;
  --soft: #efebe3;

  --radius: 4px;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, sans-serif;
}
/* Navidad y Reyes se ven igual: la app no depende de la temporada */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 18px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 20px 64px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0 0 .45em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.2rem, 9vw, 2.9rem); }
h2 { font-size: 1.6rem; margin-top: 2.2em; padding-top: 1.1em; border-top: 1px solid var(--line); }
h3 { font-size: 1.2rem; }
em { font-style: italic; }
p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration-color: var(--hair); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.eyebrow { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); font-weight: 700; margin: 26px 0 12px; }
.lead { font-size: 1.05rem; color: var(--muted); }
hr.rule-short { width: 48px; border: 0; border-top: 1px solid var(--hair); margin: 26px 0 22px; }

.top { max-width: 560px; width: 100%; margin: 0 auto; padding: 22px 20px 0; }
.brand { font-family: var(--serif); font-size: 1.7rem; line-height: 1; color: var(--ink); text-decoration: none; }
.brand i { font-style: normal; color: var(--burgundy); }
.foot { max-width: 560px; width: 100%; margin: 0 auto; padding: 22px 20px 32px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }
.foot em { font-family: var(--serif); font-size: .95rem; }

/* ---- botones ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 58px; padding: 0 26px; border-radius: var(--radius);
  font: 700 .95rem var(--sans); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary);
  transition: background .15s, color .15s;
}
.btn:hover { background: #2e2d2b; border-color: #2e2d2b; }
.btn:active { transform: translateY(1px); }
.btn.ghost, .btn.plain { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover, .btn.plain:hover { background: var(--ink); color: var(--paper); }
.btn.wa::before { content: ""; width: 19px; height: 19px; flex: none; background: currentColor; -webkit-mask: var(--wa-icon) center/contain no-repeat; mask: var(--wa-icon) center/contain no-repeat; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
:root { --wa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18.2a8.2 8.2 0 0 1-4.2-1.2l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2zm4.5-6.1c-.2-.1-1.5-.7-1.7-.8s-.4-.1-.6.1-.7.8-.8 1-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.2-.4.2-.4.7-1.3.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5a1 1 0 0 0-.7.3 3 3 0 0 0-.9 2.2 5.2 5.2 0 0 0 1.1 2.7 11.8 11.8 0 0 0 4.5 4c1.7.7 2.3.8 3.2.6a2.7 2.7 0 0 0 1.8-1.3 2.2 2.2 0 0 0 .2-1.3c-.1-.1-.3-.2-.5-.3z'/%3E%3C/svg%3E"); }
.linkbtn { background: none; border: 0; padding: 8px 0; color: var(--ink); font: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 4px; cursor: pointer; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 10px; }
.btn:focus-visible, .linkbtn:focus-visible, .iconbtn:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---- formularios ---- */
label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.hint { display: block; font-weight: 500; color: var(--muted); font-size: .88rem; }
input[type=text], input[type=url], textarea, select {
  width: 100%; min-height: 56px; padding: 12px 14px;
  font: 500 1.02rem var(--sans); color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a29c8f; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.field { margin-bottom: 22px; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  margin: 0; padding: 18px 12px; text-align: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  font-family: var(--serif); font-weight: 400; font-size: 1.4rem;
}
.choice label small { display: block; font: 600 .8rem var(--sans); color: var(--muted); margin-top: 2px; letter-spacing: .02em; }
.choice input:checked + label { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 3px; }

.people { list-style: none; padding: 0; margin: 0 0 12px; counter-reset: p; }
.people li { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; counter-increment: p; }
.people li::before { content: counter(p); width: 1.5em; text-align: right; color: var(--gold-text); font-family: var(--serif); font-size: 1.05rem; flex: none; }
.people input { flex: 1; }
.iconbtn {
  flex: none; width: 56px; height: 56px; border-radius: var(--radius);
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.iconbtn:hover { color: var(--ink); border-color: var(--ink); }

.rule { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 6px 0 6px 2px; margin-bottom: 4px; }
.rule span { flex: 1; }
.rule .iconbtn { width: 44px; height: 44px; font-size: 1.1rem; border-color: transparent; }
.ruleform { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin: 12px 0 8px; }
.ruleform .sep { color: var(--muted); font-size: .85rem; text-align: center; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 44px; margin: 4px 0 10px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }

details { border-top: 1px solid var(--line); padding: 12px 0; }
details > summary { cursor: pointer; font-family: var(--serif); font-size: 1.35rem; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; font-family: var(--sans); font-weight: 300; color: var(--ink); font-size: 1.6rem; }
details[open] > summary::after { content: "−"; }

.error { border: 1px solid var(--burgundy); color: var(--burgundy); background: var(--card); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 600; }
.note { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 18px 0; margin: 22px 0; }
.note p:last-child { margin-bottom: 0; }
.alert { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; margin: 0 0 22px; font-weight: 700; }

/* ---- portada ---- */
.hero { padding: 18px 0 8px; }
.hero h1 { font-size: clamp(2.6rem, 12vw, 3.6rem); line-height: 1.02; margin-bottom: 0; }
.hero h1 em { color: var(--burgundy); }
.promises { color: var(--muted); font-size: .84rem; letter-spacing: .04em; margin: 14px 0 0; text-align: center; }
.steps { list-style: none; padding: 0; margin: 44px 0 0; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 38px 1fr; gap: 8px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.steps b { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; color: var(--gold-text); line-height: 1.2; }
.steps strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; line-height: 1.2; margin-bottom: 2px; }
.steps span { color: var(--muted); }

/* ---- panel del organizador ---- */
.list { list-style: none; padding: 0; margin: 0; }
.person { border-bottom: 1px solid var(--line); padding: 18px 0; }
.list .person:first-child { border-top: 1px solid var(--line); }
.person .who { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.person .who strong { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; }
.badge { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ink); }
.badge.ok::before { content: "✓ "; }
.result { width: 100%; border-collapse: collapse; border-top: 1px solid var(--line); }
.result td { padding: 13px 4px; border-bottom: 1px solid var(--line); }
.result td:first-child, .result td:last-child { font-family: var(--serif); font-size: 1.15rem; }
.result td:nth-child(2) { color: var(--gold-text); width: 2em; text-align: center; }

/* ---- tarjeta de rascar ---- */
.ticket {
  position: relative; margin: 26px auto 18px; max-width: 440px; aspect-ratio: 7 / 4;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; touch-action: none; user-select: none;
}
.ticket::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--hair); }
.ticket .inside { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 26px; }
.ticket .inside small { color: var(--gold-text); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
.ticket .inside .name { font-family: var(--serif); font-size: clamp(2.1rem, 10vw, 3rem); color: var(--accent); line-height: 1.08; overflow-wrap: anywhere; }
.ticket canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; transition: opacity .6s; }
.ticket canvas.gone { opacity: 0; pointer-events: none; }

.wish { border-bottom: 1px solid var(--line); padding: 14px 0; display: flex; gap: 10px; align-items: flex-start; }
.list .wish:first-child { border-top: 1px solid var(--line); }
.wish div { flex: 1; min-width: 0; }
.wish strong { font-weight: 700; }
.wish .meta { color: var(--muted); font-size: .9rem; }
.wish a { font-size: .9rem; font-weight: 600; }
.q { border-bottom: 1px solid var(--line); padding: 14px 0; }
.list .q:first-child { border-top: 1px solid var(--line); }
.q .a { margin-top: 8px; padding-left: 14px; border-left: 1px solid var(--hair); font-family: var(--serif); font-size: 1.1rem; }
.q .wait { color: var(--muted); font-style: italic; font-size: .9rem; margin-top: 4px; }
.empty { color: var(--muted); font-style: italic; }

#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140px);
  background: var(--ink); color: var(--paper); padding: 13px 22px; border-radius: var(--radius);
  font-size: .92rem; font-weight: 600; transition: transform .3s ease; max-width: calc(100% - 32px); z-index: 10;
}
#toast.show { transform: translate(-50%, 0); }

dialog.ask {
  width: min(440px, calc(100% - 32px)); padding: 28px 24px 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font-size: 1.05rem;
}
dialog.ask::backdrop { background: rgba(23, 23, 22, .45); }
dialog.ask p { margin: 0 0 22px; }
.ask-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ask-actions .btn { padding: 0 12px; }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
