/* =============================================================================
   HOLADOOR — Sistema de diseño
   Identidad propia, distinta de la app de restaurantes: «Etiqueta». Negro de esmoquin
   (como el conejo del logo), marfil de invitación y champán para los detalles.
   Botones tipo cápsula con letras en mayúscula espaciadas; títulos en serif
   de gala y una cursiva de acento («Bienvenidos»).
   1 Tokens · 2 Base · 3 Componentes · 4 Marco de la app · 5 Pantallas
   ============================================================================= */

/* ---------- 1. Tokens ------------------------------------------------------ */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2"); }
/* Tipografía inspirada en Grande Laguna (versión DEMO: solo uso personal, sin acentos ni números).
   Se usan equivalentes libres para uso comercial (licencia OFL, en /fonts): Gilda Display
   (serif de títulos) y Parisienne (cursiva de acento). Si se compra la licencia comercial de
   Grande Laguna, alcanza con cambiar estos dos @font-face. */
@font-face { font-family: "Gilda Display"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/gilda-display-regular.ttf") format("truetype"); }
@font-face { font-family: "Parisienne"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/parisienne-regular.ttf") format("truetype"); }
@font-face { font-family: "Caladea"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/caladea-latin-700-normal.woff2") format("woff2"); }

:root {
  /* Constantes de marca (no cambian con el modo oscuro) */
  --ink: #15131a;          /* negro de esmoquin */
  --ivory: #f7f3ec;        /* marfil */
  --champagne: #c9a86a;    /* champán: detalles sobre fondo oscuro */
  --champagne-deep: #9c7c45;

  --bg: #f7f3ec;
  --surface: #fffdf9;
  --surface-2: #fbf7f0;
  --fill: rgba(60, 48, 30, 0.07);
  --fill-strong: rgba(60, 48, 30, 0.15);
  --line: rgba(40, 32, 20, 0.14);

  --text: #15131a;
  --text-2: #5e574d;
  --text-3: #857d70;
  --on-accent: #f7f3ec;

  --accent: #15131a;
  --accent-hover: #2b2731;
  --accent-press: #000000;
  --accent-tint: rgba(21, 19, 26, 0.05);
  --accent-tint-2: rgba(21, 19, 26, 0.11);
  --gold: #c9a86a;
  --gold-ink: #7d6235;
  --ring: rgba(201, 168, 106, 0.55);
  --bar: #9c7c45;

  --ok: #1d6b3d;      --ok-tint: rgba(29, 107, 61, 0.11);
  --warn: #8a5300;    --warn-tint: rgba(214, 150, 40, 0.16);
  --bad: #b3261e;     --bad-tint: rgba(179, 38, 30, 0.09);
  --info: #2c5a8a;    --info-tint: rgba(44, 90, 138, 0.10);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-brand: "Caladea", Georgia, serif;
  --font-display: "Gilda Display", "Didot", Georgia, serif;
  --font-script: "Parisienne", "Snell Roundhand", cursive;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(21, 19, 26, 0.05), 0 6px 20px rgba(21, 19, 26, 0.05);
  --shadow-lg: 0 12px 44px rgba(21, 19, 26, 0.2);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121016; --surface: #1b1820; --surface-2: #221e27;
    --fill: rgba(240, 225, 200, 0.07); --fill-strong: rgba(240, 225, 200, 0.14); --line: rgba(240, 225, 200, 0.12);
    --text: #f2ede3; --text-2: #b4ab9d; --text-3: #8d8578;
    --accent: #d4b57a; --accent-hover: #e0c48e; --accent-press: #c3a366; --on-accent: #15131a;
    --accent-tint: rgba(212, 181, 122, 0.09); --accent-tint-2: rgba(212, 181, 122, 0.18);
    --gold: #d4b57a; --gold-ink: #e2c992; --bar: #d4b57a;
    --ok: #74d39c; --ok-tint: rgba(116, 211, 156, 0.13); --warn: #f1c36a; --warn-tint: rgba(241, 195, 106, 0.14);
    --bad: #ff8f87; --bad-tint: rgba(255, 143, 135, 0.12); --info: #8dbbf0; --info-tint: rgba(141, 187, 240, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-lg: 0 12px 44px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
/* ---------- 2. Base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 400; letter-spacing: 0.005em; line-height: 1.15; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
img { max-width: 100%; }
.muted { color: var(--text-2); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--mono); letter-spacing: 0.04em; }
.num { font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.stack-lg { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.eyebrow { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-2); }
.script { font-family: var(--font-script); font-weight: 400; letter-spacing: 0; line-height: 1; }
.display { font-family: var(--font-display); font-weight: 400; }
.brand-word { font-family: var(--font-brand); font-weight: 700; letter-spacing: 0.01em; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 3. Componentes ------------------------------------------------- */
/* Botones «Etiqueta»: cápsula, mayúsculas espaciadas. Contorno por defecto, negro lleno el principal. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 22px; border-radius: var(--r-pill);
  border: 1px solid var(--text); background: transparent; color: var(--text); font: 600 0.74rem/1 var(--font); letter-spacing: 0.13em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--accent-tint-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: default; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.gold { border-color: var(--champagne-deep); color: var(--gold-ink); }
.btn.gold:hover { background: rgba(201, 168, 106, 0.14); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--fill); color: var(--text); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad-tint); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 32px; padding: 0 14px; font-size: 0.68rem; letter-spacing: 0.11em; }
.btn.lg { min-height: 52px; padding: 0 28px; font-size: 0.8rem; }
.btn.block { width: 100%; }
.btn .ico svg { width: 16px; height: 16px; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 5px; }
.field > span, .label { font-size: 0.82rem; font-weight: 550; color: var(--text-2); }
.field .hint { font-size: 0.8rem; color: var(--text-3); }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: 400 0.95rem var(--font); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--champagne-deep); outline: 3px solid var(--ring); outline-offset: 0; }
.input[type="color"] { padding: 3px; width: 56px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-error { color: var(--bad); font-size: 0.88rem; font-weight: 500; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.card.flat { box-shadow: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: var(--fill); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-tint); color: var(--ok); }
.pill.warn { background: var(--warn-tint); color: var(--warn); }
.pill.bad { background: var(--bad-tint); color: var(--bad); }
.pill.info { background: var(--info-tint); color: var(--info); }
.pill.accent { background: var(--accent-tint-2); color: var(--accent); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .t-name { font-weight: 600; }
.table .t-sub { font-size: 0.8rem; color: var(--text-2); overflow-wrap: anywhere; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 11px 14px; border: 0; background: none; color: var(--text-2); font: 600 0.92rem var(--font); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.seg { display: inline-flex; background: var(--fill); padding: 3px; border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: 600 0.84rem var(--font); color: var(--text-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.stat { display: grid; gap: 2px; }
.stat .v { font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .k { font-size: 0.8rem; color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stats .card { padding: 16px; }
.bar { height: 8px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--bar); border-radius: 99px; transition: width .4s; }

.empty { text-align: center; padding: 36px 16px; color: var(--text-2); display: grid; gap: 10px; justify-items: center; }
.empty h3 { color: var(--text); }
.callout { border-radius: var(--r); padding: 12px 14px; background: var(--info-tint); color: var(--text); font-size: 0.9rem; }
.callout.warn { background: var(--warn-tint); }
.callout.bad { background: var(--bad-tint); }
.callout.ok { background: var(--ok-tint); }

/* Hojas modales (abajo en el teléfono, centradas en la compu) */
.modal-back { position: fixed; inset: 0; background: rgba(20, 12, 16, 0.45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: var(--r-xl); width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal.wide { width: min(860px, 100%); }
.modal-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 0; }
.modal-body { padding: 16px 20px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.modal-foot { padding: 0 20px 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) {
  .modal-back { place-items: end stretch; padding: 0; }
  .modal { width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom, 0px); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow-lg); font-size: 0.92rem; animation: rise .2s; }
.toast.bad { background: var(--bad); color: #fff; }

/* ---------- 4. Marco de la app --------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 14px; min-height: 58px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-img { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.auth-logo { display: block; width: min(260px, 70%); }
.auth-logo img { width: 100%; height: auto; display: block; }
.door-logo { width: 26px; height: auto; flex: none; opacity: .95; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.logo-mark svg { width: 18px; height: 18px; }
.logo-text { display: grid; line-height: 1.05; }
.logo-text b { font-weight: 800; font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase; }
.logo-text small { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 0.9rem; }
.nav a:hover { background: var(--fill); color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-tint); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.who .org { font-size: 0.84rem; color: var(--text-2); max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { max-width: 1180px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (max-width: 720px) { .who .org { display: none; } .logo-text small { display: none; } .page { padding-top: 16px; } }

/* ---------- 5. Pantallas --------------------------------------------------- */
/* Acceso (login, registro...) */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: var(--ink); color: var(--ivory); padding: 48px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.auth-side .logo { color: #fff; }
.auth-side .logo-mark { background: #fff; color: var(--ink); }
.auth-side .logo-text small { color: rgba(255,255,255,.75); }
.auth-side h1 { font-family: var(--font-display); font-size: clamp(2.1rem, 1.4rem + 2.4vw, 3.3rem); line-height: 1.08; font-weight: 400; max-width: 16ch; }
.auth-script { font-family: var(--font-script); font-size: clamp(2.2rem, 1.6rem + 2vw, 3.4rem); color: var(--gold); line-height: 1; margin: 0 0 4px; display: flex; align-items: center; gap: 14px; }
.auth-script::after { content: ""; height: 1px; width: 64px; background: currentColor; opacity: .7; }
.auth-card h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; }
.auth-side p.lead { font-size: 1.05rem; max-width: 46ch; color: rgba(255,255,255,.86); margin-top: 14px; }
.auth-side ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; max-width: 46ch; }
.auth-side li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: rgba(255,255,255,.92); }
.auth-side li b { color: #fff; }
.auth-side li svg { width: 20px; height: 20px; color: var(--gold); margin-top: 2px; }
.ticket-art { position: absolute; right: -60px; bottom: -40px; width: 340px; opacity: .13; transform: rotate(-14deg); pointer-events: none; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 18px; }
.auth-card h2 { font-size: 1.45rem; }
.auth-foot { font-size: 0.88rem; color: var(--text-2); text-align: center; }
.auth-lang { display: flex; justify-content: center; }
.lang-select { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: var(--r-pill); padding: 6px 8px; font: 500 0.84rem var(--font); cursor: pointer; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 20px 30px; }
  .auth-side ul { display: none; }
  .auth-logo { width: 170px; }
  .auth-side h1 { font-size: 1.7rem; }
  .auth-side p.lead { font-size: 0.95rem; }
}

/* Lista de eventos */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.event-card { display: grid; gap: 12px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; position: relative; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.event-card:hover { border-color: var(--fill-strong); box-shadow: var(--shadow); }
.event-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ev, var(--accent)); }
.event-card h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; }
.event-card .date { font-size: 0.82rem; color: var(--text-2); }
.event-card .meta { display: flex; gap: 14px; font-size: 0.84rem; color: var(--text-2); flex-wrap: wrap; }
.event-card .meta b { color: var(--text); font-variant-numeric: tabular-nums; }

/* Evento */
.event-head { display: grid; gap: 6px; }
.event-head .row { gap: 8px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.step .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--fill); color: var(--text-2); }
.step.done .n { background: var(--ok-tint); color: var(--ok); }
.step.now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.step.now .n { background: var(--accent); color: var(--on-accent); }
.step p { font-size: 0.86rem; color: var(--text-2); margin-top: 2px; }
.step .btn { margin-top: 10px; }
.drop { border: 2px dashed var(--fill-strong); border-radius: var(--r-lg); padding: 28px 16px; text-align: center; display: grid; gap: 8px; justify-items: center; cursor: pointer; background: var(--surface); transition: border-color .15s, background-color .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-tint); }
.drop svg { width: 34px; height: 34px; color: var(--accent); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 0.82rem; cursor: pointer; user-select: none; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.timeline { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding-top: 8px; }
.timeline i { flex: 1; background: var(--bar); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.feed { display: grid; }
.feed > div { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.88rem; }
.feed > div:first-child { border-top: 0; }
.copy-box { min-width: 0; display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 6px 6px 12px; }
.copy-box code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 0.82rem; }
.qr-box { display: grid; justify-items: center; gap: 8px; }
.qr-box img { width: 200px; height: 200px; image-rendering: pixelated; border-radius: 8px; background: #fff; padding: 8px; }

/* Puerta (escáner): pantalla completa, pensada para usar con una mano */
body.door { background: var(--ink); color: #f2ede3; min-height: 100dvh; }
.door-wrap { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); }
.door-top { display: flex; align-items: center; gap: 10px; }
.door-top .ev { min-width: 0; flex: 1; }
.door-top .ev b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.door-top .ev small { color: #b3a8ad; }
.door-count { text-align: right; font-variant-numeric: tabular-nums; }
.door-count b { font-size: 1.5rem; line-height: 1; }
.door-count small { display: block; color: #b3a8ad; font-size: 0.72rem; }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; color: #b3a8ad; }
.net .dot { background: #6fd69c; }
.net.off .dot { background: #f4c35e; }
.cam { position: relative; width: 100%; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: #000; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .frame { position: absolute; inset: 16%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.32); border: 3px solid rgba(255,255,255,.9); }
.cam .off { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; gap: 12px; align-content: center; color: #ddd; }
.door-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.door .btn { color: #f2ede3; border-color: rgba(242, 237, 227, 0.35); }
.door .btn:hover { background: rgba(242, 237, 227, 0.08); }
.door .door-leave { border-color: transparent; color: #a79f93; padding: 0 6px; flex: none; }
.door .btn.primary { background: var(--champagne); border-color: var(--champagne); color: var(--ink); }
.door .btn.primary:hover { background: #d8bb83; }
.door-tools select { background: #221e27; border: 1px solid #3a3440; color: #f2ede3; border-radius: var(--r-pill); }
.door-tools select { min-height: 40px; border-radius: var(--r-sm); padding: 0 10px; font: 600 0.88rem var(--font); flex: 1; min-width: 0; }
.verdict { border-radius: 20px; padding: 18px; min-height: 120px; display: grid; align-content: center; gap: 4px; background: #241e21; border: 2px dashed #3a3135; color: #b3a8ad; }
.verdict .big { font-size: 1.7rem; font-weight: 800; line-height: 1.1; color: inherit; }
.verdict .name { font-size: 1.3rem; font-weight: 650; color: #fff; overflow-wrap: anywhere; }
.verdict .sub { font-size: 0.95rem; }
.verdict.ok { background: #0f5a2c; border: 2px solid #1fb35c; color: #c9f5da; }
.verdict.warn { background: #6b4300; border: 2px solid #f4c35e; color: #ffe7b0; }
.verdict.bad { background: #7a0f18; border: 2px solid #ff6b73; color: #ffd3d6; }
.verdict.flash { animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.96); } }
.verdict .act { margin-top: 8px; }
.verdict .act .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.door-search { display: grid; gap: 8px; }
.door-search input { background: #241e21; border: 1px solid #3a3135; color: #f3eef0; }
.door-results { display: grid; gap: 6px; max-height: 40dvh; overflow: auto; }
.door-results button { display: grid; grid-template-columns: 1fr auto; gap: 8px; text-align: left; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid #3a3135; background: #1b1619; color: #f3eef0; font: inherit; cursor: pointer; }
.door-results small { color: #b3a8ad; }
.door-login { display: grid; gap: 14px; align-content: center; min-height: 70dvh; }
.door-login .card { background: #1b1619; border-color: #3a3135; color: #f3eef0; }
.door-login .input { background: #241e21; border-color: #3a3135; color: #f3eef0; }

/* Entrada pública (lo que ve el asistente en su teléfono) */
body.ticket-page { background: var(--tk, #15131a); min-height: 100dvh; }
.tk-wrap { max-width: 420px; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; }
.tk { background: #fff; color: #1f1a1c; border-radius: 22px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.tk-head { padding: 22px 22px 16px; background: var(--tk, #15131a); color: #fff; border-bottom: 2px dashed rgba(255,255,255,.4); }
.tk-head small { opacity: .85; font-size: 0.75rem; letter-spacing: .08em; text-transform: uppercase; }
.tk-head h1 { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; margin-top: 2px; }
.tk-script { font-family: var(--font-script); font-size: 2rem; line-height: 1; color: var(--champagne); display: block; margin-top: 8px; }
.tk-body { padding: 18px 22px 22px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.tk-body img { width: min(260px, 80vw); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.tk-body .holder { font-family: var(--font-display); font-size: 1.7rem; font-weight: 400; }
.tk-meta { display: grid; gap: 4px; font-size: 0.92rem; color: #4a4246; }
.tk-state { font-weight: 700; padding: 6px 14px; border-radius: 999px; }
.tk-state.VALID { background: #e2f4e9; color: #127238; }
.tk-state.USED { background: #fdf0d3; color: #855700; }
.tk-state.CANCELLED { background: #fbe1e1; color: #a3121f; }
.tk-foot { text-align: center; color: rgba(255,255,255,.8); font-size: 0.8rem; display: flex; justify-content: center; }
.tk-foot img { opacity: .9; }
.tk-foot a { color: #fff; }

/* ---------- Inscripción pública (/i/<slug>) y «Mi inscripción» ---------- */
/* La tarjeta es siempre clara, como la entrada, aunque el teléfono esté en modo oscuro. */
.tk.light {
  --surface: #fffdf9; --surface-2: #fbf7f0; --fill: rgba(60, 48, 30, 0.07); --fill-strong: rgba(60, 48, 30, 0.15); --line: rgba(40, 32, 20, 0.14);
  --text: #15131a; --text-2: #5e574d; --text-3: #857d70; --on-accent: #f7f3ec;
  --accent: #15131a; --accent-hover: #2b2731; --accent-press: #000; --accent-tint: rgba(21, 19, 26, 0.05); --accent-tint-2: rgba(21, 19, 26, 0.11);
  --ok: #1d6b3d; --ok-tint: rgba(29, 107, 61, 0.11); --warn: #8a5300; --warn-tint: rgba(214, 150, 40, 0.16);
  --bad: #b3261e; --bad-tint: rgba(179, 38, 30, 0.09); --info: #2c5a8a; --info-tint: rgba(44, 90, 138, 0.10);
  color: var(--text);
}
.reg-wrap { max-width: 560px; }
.reg-meta { display: grid; gap: 2px; margin-top: 8px; font-size: 0.9rem; color: rgba(255, 255, 255, 0.85); }
.reg-body { padding: 20px 22px 24px; display: grid; gap: 16px; }
.reg-body h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; }
.reg-body .lead { color: var(--text-2); white-space: pre-line; font-size: 0.95rem; }
.reg-body form .btn.lg { width: 100%; }
.reg-done { display: grid; gap: 12px; justify-items: center; text-align: center; }
.reg-manage { display: grid; gap: 8px; justify-items: center; text-align: center; padding-top: 14px; border-top: 1px dashed var(--line); }
.reg-section { border-top: 1px dashed var(--line); padding-top: 14px; }
.reg-section > summary, .reg-lost > summary { cursor: pointer; font-weight: 600; }
.reg-section > summary + form { margin-top: 12px; }
.reg-section h3 { font-size: 1rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
