/* Variante A · Nocturno: paleta de la pieza Premios Protege 365 */
:root {
  --bg: #030a1c;
  --panel: rgba(8, 24, 59, 0.94);
  --line: rgba(79, 214, 255, 0.22);
  --cyan: #4fd6ff;
  --blue: #1f66e5;          /* blanco sobre este azul: 5:1 */
  --text: #e8f1ff;
  --muted: #b9cfee;
  --muted-2: #9fc4f0;
  --field: #051028;
  --field-line: rgba(143, 178, 230, 0.38);
  --err: #ff9aa9;
  --display: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --stage-b: calc(var(--safe-b) + 9vh);   /* base del presentador */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); overflow: hidden; }

/* ---------- cámara y escenario de marca (plan B sin cámara) ---------- */
#cam { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; }
body.no-cam #cam { display: none; }

#backdrop { position: fixed; inset: 0; display: none; background: var(--bg); overflow: hidden; }
body.no-cam #backdrop, body:not(.playing) #backdrop { display: block; }
.bd-glow { position: absolute; inset: 0; background: radial-gradient(120% 60% at 50% 105%, rgba(47,123,255,0.55) 0%, rgba(47,123,255,0.12) 45%, transparent 70%); }
.bd-floor {
  position: absolute; left: -10%; right: -10%; bottom: 0; height: 40vh;
  background-image: radial-gradient(circle, rgba(79,214,255,0.42) 1.6px, transparent 2.2px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 95%); mask-image: linear-gradient(to top, #000 10%, transparent 95%);
  transform: perspective(500px) rotateX(48deg); transform-origin: bottom;
}
.bd-lines {
  position: absolute; left: 0; right: 0; top: 0; height: 32vh;
  background-image: linear-gradient(90deg, rgba(79,214,255,0.07) 1px, transparent 1px); background-size: 48px 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent); mask-image: linear-gradient(to bottom, #000, transparent);
}
.bd-platform {
  position: absolute; left: 50%; bottom: calc(var(--stage-b) - 20px); width: min(70vw, 300px); aspect-ratio: 6 / 1;
  transform: translateX(-50%); border-radius: 50%;
  border: 1.5px solid rgba(79,214,255,0.7);
  background: radial-gradient(ellipse, rgba(79,214,255,0.35), transparent 70%);
  box-shadow: 0 0 40px rgba(79,214,255,0.45);
}

/* ---------- presentador ---------- */
#src { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#stage, #poster {
  position: fixed; left: 50%; bottom: var(--stage-b); transform: translateX(-50%);
  max-height: 72vh; max-height: 72svh; max-width: 100vw; width: auto; height: auto; pointer-events: none;
}
#stage { display: none; }
body.playing #stage { display: block; }
body.playing #poster, body.ended #poster { display: none; }

/* ---------- barra superior ---------- */
#hud { position: fixed; left: 16px; right: 16px; top: calc(var(--safe-t) + 14px); z-index: 3; display: none; }
body.started #hud { display: block; }
.hud-progress { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.16); overflow: hidden; }
.hud-progress span { display: block; height: 100%; width: 0; background: var(--cyan); border-radius: inherit; }
.hud-row { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; }
.hud-brand {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-radius: 999px;
  background: rgba(6,19,48,0.72); border: 1px solid rgba(79,214,255,0.2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hud-brand img { height: auto; display: block; }
.hud-logo-pac { width: 96px; }
.hud-logo-p365 { width: 80px; }
.hud-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.25); }
.icon-btn {
  width: 44px; height: 44px; min-width: 0; min-height: 0; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(6,19,48,0.72); border: 1px solid rgba(79,214,255,0.25); color: var(--text);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.icon-btn .ico-off { display: none; }
.icon-btn[aria-pressed="true"] .ico-on { display: none; }
.icon-btn[aria-pressed="true"] .ico-off { display: block; }

#tagline {
  position: fixed; left: 0; right: 0; bottom: calc(var(--safe-b) + 18px); margin: 0; text-align: center; pointer-events: none;
  font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2);
}
body.ended #tagline { display: none; }

#status {
  position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 92px); margin: 0; text-align: center; z-index: 3;
  font-size: 14px; color: var(--text); text-shadow: 0 1px 3px #000; pointer-events: none;
}

/* ---------- botones ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; appearance: none; cursor: pointer;
  min-height: 52px; min-width: 200px; padding: 14px 26px; border: 0; border-radius: 12px;
  font-family: var(--display); font-size: 16px; font-weight: 600; text-decoration: none;
  background: var(--blue); color: #fff;
}
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
button:disabled { opacity: .6; cursor: progress; }
.ghost { background: transparent; border: 1px solid rgba(143,178,230,0.5); color: var(--text); }
.link { min-height: 44px; min-width: 0; padding: 6px 10px; background: none; color: var(--muted-2); font-family: var(--body); font-size: 14px; font-weight: 600; text-decoration: underline; }

#tap { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 24px); transform: translateX(-50%); z-index: 5; }

/* ---------- paneles (bienvenida, cierre, formulario) ---------- */
.eyebrow { display: block; font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--cyan); }

dialog#intro, #end .card {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
dialog#intro {
  padding: 30px 24px 22px; max-width: 360px; width: calc(100% - 32px); text-align: center;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(79,214,255,0.12), transparent 60%),
    var(--panel);
}
dialog#intro::before {        /* filo de luz superior */
  content: ""; position: absolute; left: 18%; right: 18%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}
dialog#intro::backdrop { background: rgba(3,10,28,0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog .logos { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0 0 24px; }
dialog .logos img { height: auto; display: block; }
dialog .logos img:first-child { width: 120px; }
dialog .logos img:last-child { width: 140px; }
.logos-sep { width: 1px; height: 36px; background: rgba(255,255,255,0.25); }
dialog h1 { font-family: var(--display); font-size: 24px; line-height: 1.2; font-weight: 700; margin: 8px 0 20px; color: #fff; text-wrap: balance; }
dialog h1:focus { outline: none; }
dialog small { display: block; font-size: 12px; color: var(--muted-2); }

/* qué va a pasar: dos pasos con icono, alineados a la izquierda para leerse rápido */
.steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; text-align: left; }
.steps li {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px;
  background: rgba(5,16,40,0.7); border: 1px solid rgba(79,214,255,0.14);
  font-size: 14px; line-height: 1.4; color: var(--muted);
}
.steps b { color: #fff; font-weight: 700; }
.step-ico {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--cyan); background: rgba(79,214,255,0.10);
}

/* botón principal con el avance de carga como relleno */
.cta { position: relative; width: 100%; overflow: hidden; isolation: isolate; gap: 10px; box-shadow: 0 8px 24px rgba(31,102,229,0.35); }
.cta-fill {
  position: absolute; inset: 0 auto 0 0; width: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(79,214,255,0.0), rgba(79,214,255,0.35));
  transition: width .2s linear, opacity .4s ease;
}
.cta.done .cta-fill { opacity: 0; }
.cta.indeterminate .cta-fill { width: 40%; animation: indet 1.2s ease-in-out infinite; }
.cta-label { display: inline-flex; align-items: center; gap: 10px; }
.cta:active { transform: scale(0.98); }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.load-text { margin-top: 10px; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.cta.done + .load-text { color: var(--cyan); }
.privacy {             /* candado en línea con el texto: acompaña a la primera línea aunque el texto se parta */
  margin-top: 14px; padding: 14px 8px 0; border-top: 1px solid rgba(143,178,230,0.14); line-height: 1.5; text-wrap: balance;
}
.privacy svg { display: inline-block; vertical-align: -2px; margin-right: 5px; }

#end {
  position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; padding: calc(var(--safe-t) + 20px) 16px calc(var(--safe-b) + 20px);
  overflow-y: auto; background: rgba(3,10,28,0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: fade .4s ease-out;
}
#end .card { width: 100%; max-width: 380px; padding: 26px 22px 22px; display: grid; gap: 14px; }
#end h2 { font-family: var(--display); font-size: 24px; line-height: 1.25; font-weight: 700; margin: 0; color: #fff; }
#end-main, #thanks { text-align: center; }
#end-main button, #thanks button { width: 100%; }
#end .detail { margin: 0 0 4px; font-size: 16px; line-height: 1.55; color: var(--muted); }
#thanks p { font-size: 16px; line-height: 1.55; margin: 0 0 6px; color: var(--muted); }

/* ---------- formulario ---------- */
#end .ask { margin: 6px 0 0; font-family: var(--display); font-size: 15px; font-weight: 600; color: #fff; }
#end-main .link { justify-self: center; width: auto; }

#rsvp { text-align: left; gap: 14px !important; }
.form-head { display: grid; gap: 10px; }
.steps-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.steps-bar span { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.14); }
.steps-bar span:first-child, #rsvp[data-paso="2"] .steps-bar span { background: var(--cyan); }
.form-step { display: grid; gap: 12px; }
#rsvp label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
#rsvp input:not([type="radio"]):not([type="checkbox"]) {
  font: inherit; font-size: 16px; font-weight: 400; color: #fff; width: 100%;
  padding: 11px 14px; border-radius: 12px; background: var(--field); border: 1px solid var(--field-line);
}
#rsvp .form-step button { width: 100%; margin-top: 4px; }
#rsvp input::placeholder { color: rgba(185,207,238,0.45); font-weight: 400; }
#rsvp .prefixed { position: relative; display: block; }
#rsvp .prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none;
  font-size: 16px; font-weight: 600; color: var(--muted); padding-right: 10px; border-right: 1px solid var(--field-line);
}
#rsvp .prefixed input { padding-left: 64px !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#rsvp input:not([type="radio"]):not([type="checkbox"]):focus-visible { outline: none; border: 1.5px solid var(--cyan); box-shadow: 0 0 0 4px rgba(79,214,255,0.15); }
#rsvp input[aria-invalid="true"] { border-color: var(--err) !important; }
#rsvp fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
#rsvp legend { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; padding: 0; }
#rsvp .opt {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; cursor: pointer;
  background: var(--field); border: 1px solid var(--field-line); font-size: 16px; font-weight: 600; color: #dbe7fb;
}
#rsvp .opt:has(input:checked) { border: 1.5px solid var(--cyan); background: rgba(79,214,255,0.10); color: #fff; }
#rsvp .opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--cyan); }
#rsvp .check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--muted); cursor: pointer; }
#rsvp .check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--cyan); }
#rsvp .check a { color: var(--cyan); }
#rsvp .err { font-size: 13px; font-weight: 600; color: var(--err); }
#rsvp .err:empty { display: none; }
#rsvp .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#rsvp .link { justify-self: center; }

@keyframes fade { from { opacity: 0 } }
@media (prefers-reduced-motion: reduce) {
  #end { animation: none; }
  .cta-fill { transition: none; animation: none !important; }
  .cta:active { transform: none; }
}

/* Formulario corto (no asiste): solo documento, nombre, razón social y autorización */
#rsvp[data-modo="no"] .solo-si { display: none !important; }
#rsvp .turnstile:empty { display: none; }
#rsvp .turnstile { min-height: 0; }
