/* Motor de la invitación demo. Los colores y letras salen de temas.css. */
body { padding-bottom: 0; font-family: var(--texto); }
main { position: relative; z-index: 1; min-height: 100svh; display: grid; place-items: center; padding: 80px 16px 110px; }
.pantalla { width: 100%; display: grid; justify-items: center; text-align: center; }
.pantalla.activa { animation: entrar .7s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes entrar { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.chispas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.flores { display: none; }
.cielo { position: fixed; height: 100%; }
a { color: var(--acento1); }
.etiqueta { color: var(--etiqueta-color); font-size: .8rem; letter-spacing: .2em; }
.brillo-texto { background: var(--degradado); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- botones de la piel ---------- */
.boton { background: var(--degradado); color: var(--boton-tinta); border-radius: 12px; font-weight: 600; }
.boton:hover { background: var(--degradado); filter: brightness(1.06); }
.boton.sec { background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 1.5px rgba(var(--a2-rgb), .8); }
.boton.sec:hover { background: rgba(var(--a2-rgb), .1); filter: none; }
.boton.grande { min-height: 58px; padding: 16px 32px; font-size: 1.08rem; min-width: min(100%, 300px); }
a:focus-visible, button:focus-visible, input:focus-visible, .opcion:focus-within { outline: 3px solid var(--acento1); outline-offset: 3px; }
input[type="text"], input[type="email"] { background: var(--campo); border-color: var(--borde-campo); color: var(--tinta); }
input[aria-invalid="true"] { border-color: var(--error); }
label { color: var(--suave); }

/* ---------- controles flotantes (orden visual: volver, estilo, música) ---------- */
.flotante { background: rgba(10, 8, 5, .92); border: 1px solid var(--borde); color: var(--suave); }
.a-demo { position: fixed; z-index: 50; top: max(14px, env(safe-area-inset-top)); left: 14px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 10px; text-decoration: none; font: 600 .88rem/1 var(--texto); }
.a-demo:hover { color: var(--tinta); }
.sonido { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 50; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.ondas { display: flex; gap: 3px; align-items: end; height: 18px; }
.ondas i { width: 3px; height: 100%; border-radius: 2px; background: var(--acento1); animation: onda 1s ease-in-out 5; }
.ondas i:nth-child(2) { animation-delay: -.3s; } .ondas i:nth-child(3) { animation-delay: -.6s; } .ondas i:nth-child(4) { animation-delay: -.15s; }
@keyframes onda { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.sonido[aria-pressed="false"] .ondas i { animation: none; transform: scaleY(.25); opacity: .6; }
.pie-inv { position: relative; z-index: 1; display: flex; justify-content: center; padding: 0 16px 28px; margin-top: -90px; }
.pausar-flota { color: var(--suave); font-size: .9rem; padding: 8px 14px; border-radius: 8px; }

.selector-estilo { position: fixed; z-index: 55; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; }
.se-boton { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 10px; font: 600 .88rem/1 var(--texto); cursor: pointer; white-space: nowrap; }
.se-boton b { color: var(--tinta); font-weight: 600; }
.se-punto { width: 14px; height: 14px; border-radius: 50%; background: var(--degradado); }
.se-lista { display: grid; gap: 6px; padding: 8px; border-radius: 12px; background: #17120a; border: 1px solid var(--borde); }
.se-lista button { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent; background: rgba(255, 255, 255, .05); color: #f6efe1; font: 600 .92rem/1.2 var(--texto); cursor: pointer; text-align: left; white-space: nowrap; }
.se-lista button[aria-checked="true"] { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .12); }
.se-lista i { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 1px solid rgba(128, 128, 128, .5); }
.m-dorado { background: radial-gradient(circle at 35% 30%, #f8e8aa, #c9a24e 55%, #1a140a); }
.m-floral { background: radial-gradient(circle at 40% 40%, #ffd1e3, #b8325f 60%, #146b66); }
.m-minimal { background: linear-gradient(135deg, #ffffff 50%, #111111 50%); }

/* ---------- portal ---------- */
#portal { gap: 16px; }
.anillo { position: relative; width: min(56vw, 260px); aspect-ratio: 1; margin-bottom: 8px; }
.anillo-luz { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, var(--acento1), var(--acento2), var(--acento3), var(--acento1)); animation: girar 6s linear 1;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); }
.anillo::before { content: ""; position: absolute; inset: -14%; border-radius: 50%; background: radial-gradient(circle, rgba(var(--a2-rgb), .28), transparent 62%); }
.anillo-orbita { position: absolute; inset: 14%; border-radius: 50%; border: 1px solid rgba(var(--a1-rgb), .3); }
.anillo-orbita.o2 { inset: 25%; border-color: rgba(var(--a3-rgb), .3); }
.anillo-nucleo { position: absolute; inset: 33%; border-radius: 50%; display: grid; place-items: center; align-content: center; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .16), rgba(var(--a2-rgb), .18) 40%, var(--fondo)); }
.anillo-nucleo span { font: 600 clamp(2rem, 9vw, 3.4rem)/1 var(--titulos); color: var(--acento1); }
.anillo-nucleo small { font: 600 .8rem/1 var(--texto); letter-spacing: .4em; color: var(--suave); margin-top: 6px; padding-left: .4em; }
@keyframes girar { to { transform: rotate(360deg); } }
.portal-titulo { font-size: clamp(2rem, 8vw, 3.6rem); max-width: 14ch; }
.portal-quien { margin: -4px 0 6px; color: var(--tinta); font-weight: 600; font-size: 1.05rem; }
.nota { margin: 0; color: var(--tenue); font-size: .95rem; }
body.abriendo #portal { animation: salirPortal .8s cubic-bezier(.7, 0, .2, 1) forwards; }
body.abriendo .anillo { animation: expandir .8s cubic-bezier(.7, 0, .2, 1) forwards; }
@keyframes salirPortal { 50% { opacity: 1; } 100% { opacity: 0; } }
@keyframes expandir { 0% { transform: scale(1); } 30% { transform: scale(.9); } 100% { transform: scale(9); opacity: 0; } }
.destello { position: fixed; inset: 0; z-index: 45; pointer-events: none; background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .9) 0%, rgba(var(--a2-rgb), .6) 30%, transparent 70%); opacity: 0; }
.destello.on { animation: destello .8s ease-out forwards; }
@keyframes destello { 0% { opacity: 0; } 30% { opacity: .9; } 100% { opacity: 0; } }

/* ---------- tarjeta ---------- */
.tarjeta { position: relative; width: min(100%, 560px); padding: 34px 24px 28px; overflow: hidden; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 18px; }
.tarjeta .etiqueta { text-wrap: balance; }
.tarjeta-brillo { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .08) 45%, transparent 60%); background-size: 250% 100%; animation: barrido 5s ease-in-out 1; }
@keyframes barrido { 0% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
.nombre { font-size: clamp(2.5rem, 11.5vw, 4.6rem); margin: 10px 0 0; }
.edad { display: flex; justify-content: center; gap: 4px; margin: 2px 0 4px; font: 400 clamp(4.4rem, 22vw, 8.4rem)/.95 var(--titulos); }
.lema { margin: 0 auto 18px; color: var(--suave); max-width: 32ch; text-wrap: balance; }
.acciones { display: grid; gap: 10px; margin: 0 0 18px; }
.datos { display: grid; gap: 10px; margin: 0 0 16px; text-align: left; }
.datos > div { display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--borde); }
.datos strong { font-size: 1.08rem; }
.datos span:not(.etiqueta) { color: var(--suave); font-size: .95rem; }
.cuenta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 16px; }
.cuenta div { padding: 12px 4px 10px; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid var(--borde); }
.cuenta b { display: block; font: 600 clamp(1.4rem, 6vw, 1.9rem)/1 var(--titulos); font-variant-numeric: tabular-nums; }
.cuenta span { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--tenue); }
.acciones-sec { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acciones-sec .boton { padding: 12px 10px; font-size: .92rem; }
.revelar { opacity: 0; transform: translateY(14px); }
.pantalla.activa .revelar { animation: subir .7s cubic-bezier(.16, 1, .3, 1) forwards; }
.pantalla.activa .r1 { animation-delay: .05s; } .pantalla.activa .r2 { animation-delay: .15s; } .pantalla.activa .r3 { animation-delay: .28s; } .pantalla.activa .r4 { animation-delay: .4s; }
.pantalla.activa .r5 { animation-delay: .5s; } .pantalla.activa .r6 { animation-delay: .6s; } .pantalla.activa .r7 { animation-delay: .7s; } .pantalla.activa .r8 { animation-delay: .78s; }
@keyframes subir { to { opacity: 1; transform: none; } }
html.quieto .revelar { opacity: 1; transform: none; }

/* ---------- formulario ---------- */
.formulario { display: grid; gap: 14px; text-align: left; }
.formulario h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin: -6px 0 4px; }
.formulario .etiqueta, .formulario h1 { text-align: center; }
.error-campo { margin: 6px 0 0; font-size: .9rem; font-weight: 600; color: var(--error); }
.error-campo:empty { display: none; }
.error-campo.centro { text-align: center; margin-top: -4px; }
.error { color: var(--error); text-align: center; }
.privacidad { margin: 0; font-size: .9rem; color: var(--tenue); text-align: center; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.opciones { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opcion { margin: 0; position: relative; display: grid; place-items: center; min-height: 64px; padding: 10px; border-radius: 12px; cursor: pointer; border: 1px solid var(--borde-campo); background: var(--campo); font: 600 1rem/1.2 var(--texto); color: var(--tinta); }
.opcion input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opcion:hover { border-color: var(--acento1); }
.opcion.marcada { border: 2px solid var(--acento2); background: rgba(var(--a2-rgb), .14); }
.opciones.invalido .opcion { border-color: var(--error); }
.volver { background: none; border: 0; color: var(--suave); font: 600 .95rem var(--texto); text-decoration: underline; cursor: pointer; padding: 12px; min-height: 44px; justify-self: center; }

/* ---------- listo ---------- */
.listo { display: grid; gap: 14px; }
.sello { width: 64px; height: 1px; margin: 4px auto 6px; background: var(--acento2); }
.listo h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
.listo h1:focus { outline: none; }
.listo .lema { margin-bottom: 4px; }
.detras { margin-top: 10px; padding: 18px 16px; border-radius: 12px; border: 1px dashed var(--borde-campo); display: grid; gap: 8px; }
.detras p { margin: 0; color: var(--suave); font-size: .95rem; }
.detras-enlaces { display: grid; gap: 8px; margin-top: 6px; }
.detras-enlaces .boton { min-height: 48px; font-size: .95rem; }
.pide { display: grid; gap: 10px; justify-items: center; padding: 18px 16px; border-radius: 12px; background: rgba(var(--a2-rgb), .08); border: 1px solid var(--borde); }
.pide p { margin: 0; color: var(--tinta); }

@media (min-width: 900px) {
  .tarjeta { padding: 44px 46px 36px; }
  .datos { grid-template-columns: repeat(3, 1fr); }
  #invitacion .tarjeta { width: min(100%, 820px); }
  #invitacion .acciones { justify-items: center; }
}
@media (max-width: 420px) { .se-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .a-demo { padding: 8px 10px; } }
@media (max-height: 700px) and (max-width: 600px) { .anillo { width: min(44vw, 190px); } }

/* ---------- nueva hora ---------- */
.datos .etiqueta .nueva-hora { display: inline-block; margin-left: 8px; padding: 3px 10px; border-radius: 6px; background: var(--acento2); color: var(--boton-tinta); font: 700 .74rem/1.4 var(--texto); letter-spacing: .1em; text-transform: uppercase; vertical-align: middle; }
#d-cuando.cambiada { border: 2px solid var(--acento2); }
#d-cuando.cambiada #d-hora { color: var(--tinta); font-weight: 600; font-size: 1.05rem; }
