/* ===========================================================================
   INVITADOS QR — hoja de estilos compartida
   Mobile first. Paleta: naranja + negro + azul eléctrico. Sin vidrio.
   =========================================================================== */

:root {
  --bg: #0b0b0e;
  --bg-soft: #131317;
  --surface: #18181d;
  --surface-2: #212128;
  --line: #313139;
  --line-soft: #26262e;

  --text: #f7f6f4;
  --muted: #a8a49e;
  --muted-2: #7b7771;

  --brand: #ff6a1a;
  --brand-2: #ff9a3f;
  --brand-3: #2f80ff;          /* el tercer color: azul eléctrico */
  --brand-3-soft: #5b9dff;
  --grad: linear-gradient(135deg, #ff5207 0%, #ff7f1d 52%, #ffa93f 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 106, 26, .2), rgba(255, 154, 63, .1));
  --azul-soft: rgba(47, 128, 255, .14);

  --ok: #3ddc84;
  --ok-bg: rgba(61, 220, 132, .12);
  --warn: #ffc44d;
  --warn-bg: rgba(255, 196, 77, .12);
  --bad: #ff5f6d;
  --bad-bg: rgba(255, 95, 109, .12);
  --wa: #25d366;
  --ok-line: rgba(61, 220, 132, .4);
  --warn-line: rgba(255, 196, 77, .4);
  --bad-line: rgba(255, 95, 109, .4);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .35);
  --glow: 0 10px 28px rgba(255, 106, 26, .32);

  --nav-h: 64px;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
  accent-color: var(--brand);
  scrollbar-color: var(--line) var(--bg-soft);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}

::selection { background: var(--brand); color: #15100b; }

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 5vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 3.6vw, 1.5rem); }
p { margin: 0 0 1em; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: block; }
small { font-size: .8rem; }

:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1140px, 100% - 2rem); margin-inline: auto; }
.wrap-sm { width: min(680px, 100% - 2rem); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; color: var(--muted-2); }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; gap: .6rem; align-items: center; }
.row-wrap { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 1rem; }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* --------------------------------------------------------------- botones -- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.3rem;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit; font-weight: 700; font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--grad); border-color: transparent; color: #1a0d03; box-shadow: var(--glow); }
.btn-primary:hover { box-shadow: 0 14px 34px rgba(255, 106, 26, .48); }
.btn-azul { background: var(--brand-3); border-color: transparent; color: #fff; box-shadow: 0 10px 28px rgba(47, 128, 255, .3); }
.btn-wa { background: var(--wa); border-color: transparent; color: #042913; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad-bg); border-color: rgba(255, 95, 109, .4); color: var(--bad); }
.btn-sm { padding: .5rem .9rem; min-height: 38px; font-size: .85rem; }
.btn-xs { padding: .35rem .7rem; min-height: 32px; font-size: .78rem; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn-icon { padding: .5rem; min-height: 38px; width: 38px; border-radius: var(--r-sm); }

/* ---------------------------------------------------------------- tarjeta -- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card-tight { padding: .9rem 1rem; border-radius: var(--r); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h3 { margin: 0; }

/* ------------------------------------------------------------------ chips -- */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .7rem; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .76rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.chip-ok { background: var(--ok-bg); border-color: rgba(61, 220, 132, .35); color: var(--ok); }
.chip-warn { background: var(--warn-bg); border-color: rgba(255, 196, 77, .35); color: var(--warn); }
.chip-bad { background: var(--bad-bg); border-color: rgba(255, 95, 109, .35); color: var(--bad); }
.chip-brand { background: var(--grad-soft); border-color: rgba(255, 106, 26, .42); color: #ffc79c; }
.chip-azul { background: var(--azul-soft); border-color: rgba(47, 128, 255, .42); color: var(--brand-3-soft); }

/* ---------------------------------------------------------------- formularios -- */
.field { display: grid; gap: .35rem; margin-bottom: .9rem; }
.field > label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.field .hint { font-size: .75rem; color: var(--muted-2); }

.input, select.input, textarea.input {
  width: 100%;
  padding: .8rem .95rem;
  min-height: 48px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit; font-size: 1rem; /* 16px evita el zoom automático en iOS */
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted-2); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 106, 26, .22); }
.input:user-invalid { border-color: var(--bad); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 2.4rem; }

.grid-2 { display: grid; gap: .9rem; }
@media (min-width: 620px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2 .full { grid-column: 1 / -1; } }

.switch { display: flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .9rem; }
.switch input { width: 20px; height: 20px; flex: none; }
.switch-card {
  padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-soft); align-items: flex-start;
}
.switch-card:has(input:checked) { border-color: rgba(255, 106, 26, .5); background: var(--grad-soft); }
.switch-card .sub { font-size: .76rem; color: var(--muted-2); font-weight: 400; display: block; margin-top: .15rem; }

/* ----------------------------------------------- paleta de la invitación -- */
.paleta { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .55rem; }
.paleta label {
  position: relative; display: grid; gap: .45rem; cursor: pointer;
  padding: .55rem; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--bg-soft); transition: border-color .15s, transform .15s;
}
.paleta label:hover { transform: translateY(-2px); }
.paleta input { position: absolute; opacity: 0; pointer-events: none; }
.paleta label:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(255, 106, 26, .3); }
.paleta label:has(input:focus-visible) { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.paleta .muestra { height: 42px; border-radius: 9px; display: grid; place-items: center; }
.paleta .muestra i {
  width: 18px; height: 18px; border-radius: 4px; background: #fff; opacity: .9;
  display: block; box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.paleta .nombre { font-size: .74rem; font-weight: 700; text-align: center; color: var(--muted); }
.paleta label:has(input:checked) .nombre { color: var(--text); }

/* ------------------------------------------------------------------ navbar -- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 1rem;
  padding-inline: 1rem;
  background: #0b0b0e;
  border-bottom: 1px solid var(--line-soft);
}
.logo { display: inline-flex; align-items: center; gap: .55rem; font-weight: 900; letter-spacing: -.02em; font-size: 1.05rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; flex: none;
  box-shadow: 0 6px 18px rgba(255, 106, 26, .4);
}
.logo-mark svg { width: 19px; height: 19px; }

/* ------------------------------------------------------------- tabs / nav -- */
.tabs {
  display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: thin;
  border-bottom: 1px solid var(--line-soft); padding-bottom: 0;
}
.tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font: inherit; font-weight: 700; font-size: .9rem;
  padding: .75rem .9rem; cursor: pointer; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: #0e0e12;
  border-top: 1px solid var(--line);
}
.tabbar button {
  appearance: none; background: none; border: 0; color: var(--muted-2);
  font: inherit; font-size: .68rem; font-weight: 700;
  display: grid; justify-items: center; align-content: center; gap: 3px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tabbar button svg { width: 21px; height: 21px; }
.tabbar button[aria-selected="true"] { color: var(--brand-2); }
@media (min-width: 900px) { .tabbar { display: none; } }
.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 1rem); }
@media (min-width: 900px) { .has-tabbar { padding-bottom: 2rem; } }

/* ------------------------------------------------------------ estadísticas -- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: .9rem 1rem; }
.stat b { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat span { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }

/* ------------------------------------------------------------------ listas -- */
.list { display: grid; gap: .5rem; }
.list-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem .9rem;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r);
}
.list-item .name { font-weight: 700; font-size: .95rem; overflow-wrap: anywhere; }
.list-item .sub { font-size: .78rem; color: var(--muted-2); overflow-wrap: anywhere; }
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  background: var(--grad-soft); border: 1px solid var(--line); color: #ffcba6;
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); font-weight: 800; }
table.data tbody tr:hover { background: var(--surface-2); }

/* ------------------------------------------------------------------ dialog -- */
dialog {
  width: min(560px, calc(100vw - 1.5rem));
  max-height: min(86dvh, 860px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}
dialog::backdrop { background: rgba(4, 4, 6, .82); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem .5rem; }
.dialog-head h3 { margin: 0; font-size: 1.15rem; }
.dialog-body { padding: .5rem 1.25rem 1.25rem; overflow-y: auto; max-height: 64dvh; overscroll-behavior: contain; }
.dialog-foot { display: flex; gap: .6rem; justify-content: flex-end; padding: 0 1.25rem 1.25rem; flex-wrap: wrap; }
.x-btn { appearance: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); width: 34px; height: 34px; border-radius: 50%; font-size: 1.1rem; line-height: 1; cursor: pointer; flex: none; }

@media (prefers-reduced-motion: no-preference) {
  dialog { transition: opacity .2s ease, transform .2s ease, overlay .2s allow-discrete, display .2s allow-discrete; }
  dialog:not([open]) { opacity: 0; transform: translateY(12px) scale(.97); }
  @starting-style { dialog[open] { opacity: 0; transform: translateY(12px) scale(.97); } }
}

/* ------------------------------------------------------------------ toast -- */
#toasts {
  position: fixed; left: 50%; translate: -50% 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 1rem);
  z-index: 200; display: grid; gap: .5rem; width: min(440px, calc(100vw - 1.5rem));
  pointer-events: none;
}
@media (min-width: 900px) { #toasts { bottom: 1.5rem; } }
.toast {
  padding: .8rem 1rem; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: .9rem; font-weight: 600;
  display: flex; gap: .6rem; align-items: flex-start; pointer-events: auto;
}
.toast-ok { border-color: rgba(61, 220, 132, .5); background: #0f2a1c; color: #c9f7df; }
.toast-bad { border-color: rgba(255, 95, 109, .5); background: #2c1016; color: #ffd8dd; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .25s cubic-bezier(.2, .9, .3, 1); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
}

/* ------------------------------------------------------------------ varios -- */
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted-2); }
.empty svg { width: 48px; height: 48px; margin: 0 auto .75rem; opacity: .5; }

.divider { height: 1px; background: var(--line-soft); margin: 1.25rem 0; border: 0; }

.scroll-x { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: thin; }

/* Resalta lo que INVI BOT acaba de mostrar en el panel */
.destacar { position: relative; z-index: 1; border-radius: var(--r); box-shadow: 0 0 0 3px var(--brand), 0 0 0 10px rgba(255, 106, 26, .18); }
@media (prefers-reduced-motion: no-preference) {
  .destacar { animation: latido 1.3s ease-in-out 2; }
  @keyframes latido {
    50% { box-shadow: 0 0 0 4px var(--brand), 0 0 0 16px rgba(255, 106, 26, .08); }
  }
}

/* ================================ LANDING ================================= */
.hero {
  position: relative;
  padding: clamp(4.7rem, 10vw, 6rem) 0 clamp(3rem, 8vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: -20% -10% auto -10%; height: 130%; z-index: -1;
  background:
    radial-gradient(42rem 30rem at 15% 0%, rgba(255, 106, 26, .34), transparent 62%),
    radial-gradient(34rem 26rem at 88% 12%, rgba(255, 154, 63, .22), transparent 60%),
    radial-gradient(30rem 24rem at 50% 95%, rgba(47, 128, 255, .2), transparent 62%);
  filter: blur(6px);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-bg { animation: drift 18s ease-in-out infinite alternate; }
  @keyframes drift { to { transform: translate3d(0, -26px, 0) scale(1.06); } }
}

/* Acceso al panel: un link discreto en la esquina, sin barra que lo sostenga. */
.hero-acceso {
  position: absolute; z-index: 2;
  top: clamp(.6rem, 2.4vw, 1.1rem); right: clamp(.8rem, 3vw, 1.5rem);
}

/* ------------------------------------------------- la marca, grande, arriba --
   Aparece animada al entrar (el cuadrito se arma, el nombre sube y la bajada
   se revela) y cada tanto una línea la "escanea", como el QR en la puerta.
   Sin animaciones es el estado final, que es el que se ve igual. */
.marca-hero { display: grid; justify-items: start; gap: .6rem; margin-bottom: 1.5rem; }
.marca-fila { display: flex; align-items: center; gap: clamp(.6rem, 1.8vw, .9rem); }
.marca-mark {
  position: relative; overflow: hidden; flex: none;
  width: clamp(48px, 9.5vw, 68px); aspect-ratio: 1;
  border-radius: clamp(14px, 2.6vw, 19px); background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 12px 32px rgba(255, 106, 26, .45);
}
.marca-mark svg { width: 58%; height: 58%; }
.marca-mark svg > * { transform-box: fill-box; transform-origin: 50% 50%; }
.marca-barrido {
  position: absolute; left: 0; right: 0; top: 0; height: 34%; opacity: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .6), transparent);
}
.marca-nombre {
  margin: 0; font-weight: 900; letter-spacing: -.03em; line-height: 1;
  font-size: clamp(1.65rem, 6.8vw, 2.7rem);
}
.marca-nombre span { display: inline-block; }
.marca-bajada {
  margin: 0; color: var(--muted); font-weight: 800;
  font-size: clamp(.7rem, 2.1vw, .85rem); letter-spacing: .2em; text-transform: uppercase;
}
@media (prefers-reduced-motion: no-preference) {
  .marca-mark { animation: marca-entra .75s cubic-bezier(.2, .9, .3, 1.25) both; }
  .marca-mark svg > * { animation: marca-modulo .45s ease-out both; }
  .marca-mark svg > :nth-child(1) { animation-delay: .36s; }
  .marca-mark svg > :nth-child(2) { animation-delay: .46s; }
  .marca-mark svg > :nth-child(3) { animation-delay: .56s; }
  .marca-mark svg > :nth-child(4) { animation-delay: .66s; }
  .marca-barrido { animation: marca-barrido 4.2s 1.6s ease-in-out infinite; }
  .marca-nombre span { animation: marca-sube .65s cubic-bezier(.2, .8, .2, 1) both; }
  .marca-nombre span:nth-child(1) { animation-delay: .22s; }
  .marca-nombre span:nth-child(2) { animation-delay: .34s; }
  .marca-bajada { animation: marca-revela .8s .62s ease-out both; }
  @keyframes marca-entra { from { opacity: 0; scale: .55; rotate: -14deg; } }
  @keyframes marca-modulo { from { opacity: 0; scale: .35; } }
  @keyframes marca-sube { from { opacity: 0; translate: 0 .55em; } }
  @keyframes marca-revela {
    from { opacity: 0; clip-path: inset(0 100% 0 0); }
    to { opacity: 1; clip-path: inset(0 -4% 0 0); }
  }
  @keyframes marca-barrido {
    0% { translate: 0 -110%; opacity: 0; }
    8% { opacity: .95; }
    34% { translate: 0 300%; opacity: 0; }
    100% { translate: 0 300%; opacity: 0; }
  }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .9rem; border-radius: var(--r-pill);
  background: var(--grad-soft); border: 1px solid rgba(255, 106, 26, .42);
  font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #ffcba6;
  margin-bottom: 1.2rem;
}
.eyebrow-azul { background: var(--azul-soft); border-color: rgba(47, 128, 255, .42); color: var(--brand-3-soft); }
.lead { font-size: clamp(1.05rem, 2.8vw, 1.3rem); color: var(--muted); max-width: 46ch; }

.section { padding: clamp(3rem, 9vw, 5.5rem) 0; }
.section-alt { background: linear-gradient(180deg, transparent, var(--bg-soft) 18%, var(--bg-soft) 82%, transparent); }
.section-title { max-width: 44ch; margin-inline: auto; text-align: center; margin-bottom: clamp(2rem, 5vw, 3rem); }
.section-title p { color: var(--muted); font-size: 1.05rem; margin: 0; }

.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature { padding: 1.5rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-soft); }
.feature .ico {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid rgba(255, 106, 26, .3); margin-bottom: 1rem;
}
.feature .ico svg { width: 24px; height: 24px; stroke: var(--brand-2); }
.feature .ico-azul { background: var(--azul-soft); border-color: rgba(47, 128, 255, .32); }
.feature .ico-azul svg { stroke: var(--brand-3-soft); }
.feature h3 { font-size: 1.1rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }

.steps { display: grid; gap: 1.25rem; counter-reset: paso; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { position: relative; padding: 1.4rem 1.25rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-soft); }
.step::before {
  counter-increment: paso; content: counter(paso);
  position: absolute; top: -16px; left: 1.25rem;
  width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #1a0d03;
  display: grid; place-items: center; font-weight: 900; font-size: .95rem;
  box-shadow: 0 8px 20px rgba(255, 106, 26, .4);
}
.step h3 { font-size: 1.02rem; margin-top: .6rem; }
.step p { font-size: .9rem; color: var(--muted); margin: 0; }

.price-card {
  max-width: 520px; margin-inline: auto; text-align: center;
  padding: 2.2rem 1.6rem; border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(255, 106, 26, .16), var(--surface));
  border: 1px solid rgba(255, 106, 26, .35);
  box-shadow: var(--shadow);
}
.check-list { display: grid; gap: .6rem; text-align: left; margin: 1.5rem 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 1.85rem; font-size: .95rem; }
.check-list li::before {
  content: ''; position: absolute; left: 0; top: .17em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ok-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233ddc84' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 13px no-repeat;
  border: 1px solid rgba(61, 220, 132, .35);
}

/* El QR que se ve dentro del marco del escáner, en la sección de la puerta. */
.demo-qr {
  position: absolute; inset: 13%; border-radius: 6px; background: #fff;
  padding: 5px; display: grid; place-items: center;
}
.demo-qr svg { width: 100%; height: auto; display: block; }
.demo-linea {
  position: absolute; left: -3px; right: -3px; top: 0; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  box-shadow: 0 0 14px 3px rgba(255, 106, 26, .55); opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .demo-linea { animation: barrido 2.8s cubic-bezier(.45, 0, .55, 1) infinite; }
}

/* ------------------------------------------------- maqueta de los teléfonos -- */
.phone {
  width: min(280px, 72vw); aspect-ratio: 9 / 18.6; margin-inline: auto;
  border-radius: 34px; padding: 10px;
  background: linear-gradient(160deg, #2a2a31, #141418);
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .12);
  position: relative;
}
.phone-screen {
  width: 100%; height: 100%; border-radius: 26px; overflow: hidden;
  background: #0d0d11; display: grid; grid-template-rows: auto 1fr;
}
.phone-notch { position: absolute; top: 16px; left: 50%; translate: -50% 0; width: 78px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .22); z-index: 2; }

/* La escena del hero: la invitación en un celular y otro celular escaneándola.
   Los dos teléfonos comparten la misma celda de grilla y se separan con
   transformaciones, así se superponen sin salirse del ancho de la pantalla.   */
.escena { display: grid; place-items: center; padding-block: 1.5rem 4.5rem; }
.escena > * { grid-area: 1 / 1; }
.escena .phone-invitacion { width: min(252px, 62vw); translate: -14% 0; }
.escena .phone-escaner {
  width: min(176px, 44vw); justify-self: end; align-self: end;
  translate: 16% 14%; rotate: 6deg;
  border-radius: 26px; padding: 7px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 106, 26, .18);
}
.escena .phone-escaner .phone-screen { border-radius: 20px; grid-template-rows: 1fr; }

/* Visor de la cámara del celular que escanea */
.visor { position: relative; background: #07070a; overflow: hidden; }
.visor::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 44%, #2b2b33, #09090c 72%);
}
.visor-qr {
  position: absolute; left: 19%; top: 50%; translate: 0 -50%;
  width: 62%; aspect-ratio: 1; border-radius: 5px; background: #fff; padding: 4px;
}
.visor-marco {
  position: absolute; left: 13%; top: 50%; translate: 0 -50%;
  width: 74%; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  border: 2.5px solid rgba(255, 255, 255, .85);
}
.visor-linea {
  position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  box-shadow: 0 0 14px 3px rgba(255, 106, 26, .55);
  opacity: 0;
}
.visor-sello {
  position: absolute; inset: auto .5rem .5rem; padding: .45rem .5rem;
  border-radius: 10px; text-align: center;
  background: #0f2a1c; border: 1px solid var(--ok); color: #d2fbe8;
  font-size: .58rem; font-weight: 800; line-height: 1.3;
}
.visor-sello b { display: block; font-size: .7rem; }

@media (prefers-reduced-motion: no-preference) {
  .visor-linea { animation: barrido 3.6s cubic-bezier(.45, 0, .55, 1) infinite; }
  .visor-marco { animation: marco-ok 3.6s linear infinite; }
  .visor-sello { animation: sello 3.6s ease-out infinite; }
  .escena .phone-escaner { animation: pulso-mano 3.6s ease-in-out infinite; }

  @keyframes barrido {
    0% { top: 0; opacity: 0; }
    8% { opacity: 1; }
    42% { top: calc(100% - 3px); opacity: 1; }
    50% { top: calc(100% - 3px); opacity: 0; }
    100% { top: 0; opacity: 0; }
  }
  @keyframes marco-ok {
    0%, 45% { border-color: rgba(255, 255, 255, .85); }
    52%, 92% { border-color: var(--ok); }
    100% { border-color: rgba(255, 255, 255, .85); }
  }
  @keyframes sello {
    0%, 46% { opacity: 0; transform: translateY(10px) scale(.94); }
    56%, 90% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(10px) scale(.94); }
  }
  @keyframes pulso-mano {
    0%, 100% { translate: 16% 14%; }
    50% { translate: 16% 11%; }
  }
}

.faq details {
  border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface);
  padding: .9rem 1.1rem; margin-bottom: .6rem;
}
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.3rem; color: var(--brand-2); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq p { margin: .75rem 0 0; color: var(--muted); font-size: .94rem; }

.footer { border-top: 1px solid var(--line-soft); padding: 2.5rem 0; color: var(--muted-2); font-size: .88rem; }

.wa-float {
  position: fixed; right: 1rem; bottom: calc(1rem + var(--safe-b)); z-index: 90;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--wa); display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(37, 211, 102, .45);
}
.wa-float svg { width: 30px; height: 30px; fill: #042913; }
.wa-float:hover { text-decoration: none; }
@media (prefers-reduced-motion: no-preference) {
  .wa-float { animation: pulse 2.6s ease-in-out infinite; }
  @keyframes pulse { 0%, 100% { box-shadow: 0 12px 30px rgba(37, 211, 102, .45); } 50% { box-shadow: 0 12px 44px rgba(37, 211, 102, .75); } }
}

/* ------------------------------------------------- animaciones al scrollear --
   Progressive enhancement: sin soporte (Firefox) el contenido se ve normal.
   La animación sólo existe dentro del @supports, así nunca queda invisible.   */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes reveal-up { from { opacity: 0; transform: translateY(42px); } }
    @keyframes reveal-fade { from { opacity: 0; } }
    @keyframes reveal-scale { from { opacity: 0; transform: scale(.92); } }

    .reveal { animation: reveal-up .9s linear backwards; animation-timeline: view(); animation-range: entry 8% cover 32%; }
    .reveal-fade { animation: reveal-fade .9s linear backwards; animation-timeline: view(); animation-range: entry 5% cover 30%; }
    .reveal-scale { animation: reveal-scale .9s linear backwards; animation-timeline: view(); animation-range: entry 8% cover 34%; }
  }
}

/* ============================== INVITACIÓN ================================ */
.invite-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.invite-card { width: min(440px, 100%); border-radius: 28px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.invite-hero { padding: 2.2rem 1.5rem; text-align: center; color: #fff; }
.invite-hero .kind { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; opacity: .85; }
.invite-hero h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin: .5rem 0 .25rem; }
.invite-body { padding: 1.5rem; }
.qr-box { background: #fff; border-radius: 20px; padding: 14px; width: fit-content; margin: 0 auto; }
.qr-box img { width: min(230px, 62vw); height: auto; }
.token { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .28em; font-weight: 800; font-size: 1.05rem; }
.info-rows { display: grid; gap: .1rem; }
.info-row { display: flex; gap: .9rem; padding: .6rem 0; border-bottom: 1px solid var(--line-soft); font-size: .93rem; }
.info-row span:first-child { color: var(--muted-2); min-width: 92px; flex: none; font-size: .82rem; padding-top: .15rem; }
.info-row span:last-child { font-weight: 600; }

/* ================================ ESCÁNER ================================= */
.scan-shell { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.scan-video-wrap { position: relative; background: #000; overflow: hidden; }
.scan-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scan-frame i {
  width: min(68vw, 280px); aspect-ratio: 1; border-radius: 26px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55);
  border: 3px solid rgba(255, 255, 255, .85);
}
@media (prefers-reduced-motion: no-preference) {
  .scan-frame i { animation: scanpulse 2s ease-in-out infinite; }
  @keyframes scanpulse { 50% { border-color: var(--brand); } }
}
.scan-result { padding: 1.1rem 1.25rem; text-align: center; border-radius: var(--r-lg); margin: 0 1rem 1rem; }
.scan-result h2 { margin: 0 0 .2rem; font-size: 1.4rem; }
.scan-result p { margin: 0; font-size: .92rem; opacity: .9; }
.res-ok { background: #0f3827; border: 1px solid var(--ok); color: #d2fbe8; }
.res-bad { background: #3a1322; border: 1px solid var(--bad); color: #ffd8e0; }
.res-warn { background: #3a2c0d; border: 1px solid var(--warn); color: #ffeec4; }

/* =============================== INVI BOT ================================= */
.bot-fab {
  position: fixed; right: 1rem; bottom: calc(var(--tabbar-h) + var(--safe-b) + 1rem); z-index: 95;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 14px 34px rgba(255, 106, 26, .5);
}
@media (min-width: 900px) { .bot-fab { bottom: 1.5rem; } }
.bot-fab svg { width: 27px; height: 27px; }
.bot-fab::after {
  content: ''; position: absolute; top: 2px; right: 2px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--ok); border: 2px solid var(--bg);
}

.bot-panel {
  position: fixed; z-index: 150; inset: auto .75rem calc(var(--tabbar-h) + var(--safe-b) + 1rem) .75rem;
  max-width: 420px; margin-left: auto;
  height: min(70dvh, 580px);
  display: grid; grid-template-rows: auto 1fr auto;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
@media (min-width: 900px) { .bot-panel { bottom: 1.5rem; right: 1.5rem; } }
.bot-panel.mini { height: auto; grid-template-rows: auto; }
.bot-panel.mini .bot-log, .bot-panel.mini .bot-foot { display: none; }
.bot-head { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; background: var(--grad); color: #1a0d03; }
.bot-head strong { font-size: .98rem; }
.bot-head small { display: block; font-size: .72rem; opacity: .75; }
.bot-head .x-btn { background: rgba(0, 0, 0, .18); border-color: rgba(0, 0, 0, .22); color: #1a0d03; }
.bot-log { overflow-y: auto; padding: 1rem; display: grid; gap: .7rem; align-content: start; overscroll-behavior: contain; }
.msg { max-width: 88%; padding: .7rem .9rem; border-radius: 16px; font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; }
.msg-bot { background: var(--surface-2); border: 1px solid var(--line-soft); border-bottom-left-radius: 5px; }
.msg-user { background: var(--grad); color: #1a0d03; justify-self: end; border-bottom-right-radius: 5px; }
.msg code { background: rgba(0, 0, 0, .35); padding: .1rem .3rem; border-radius: 4px; font-size: .85em; }
.msg pre { background: rgba(0, 0, 0, .4); padding: .6rem .7rem; border-radius: 10px; overflow-x: auto; font-size: .8rem; margin: .5rem 0; }
.msg-acciones { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.msg-acciones button {
  padding: .4rem .8rem; border-radius: var(--r-pill); cursor: pointer;
  background: var(--grad); border: 0; color: #1a0d03;
  font: inherit; font-size: .78rem; font-weight: 800;
}
.msg-acciones button.secundaria { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.bot-foot { padding: .7rem; border-top: 1px solid var(--line-soft); display: grid; gap: .5rem; }
.bot-input { display: flex; gap: .5rem; }
.bot-input .input { min-height: 44px; }
.bot-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.bot-chips button {
  padding: .35rem .75rem; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  font: inherit; font-size: .75rem; cursor: pointer; text-align: left;
}
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* Dos columnas en pantallas grandes para el hero y la sección del escáner */
@media (min-width: 900px) {
  #hero-grid { grid-template-columns: 1.1fr .9fr; }
  .escaner-grid { grid-template-columns: 1fr 1fr; }
}

/* Textos que se esconden en pantallas chicas para dejar lugar en la barra */
.hide-sm { display: none; }
@media (min-width: 560px) { .hide-sm { display: inline; } }

/* Botones que aparecen recién desde pantallas medianas (mantienen el flex) */
.only-md { display: none !important; }
@media (min-width: 560px) { .only-md { display: inline-flex !important; } }

/* En el celular alcanza con la barra de abajo: las solapas de arriba sobran */
@media (max-width: 899px) { #tabs-desktop { display: none; } }
