:root {
  --rojo-1: #7a0d14;
  --rojo-2: #c81e2c;
  --rojo-3: #ff4d4d;
  --rojo-4: #3d0a0f;
  --texto: #fff5f5;
  --texto-suave: rgba(255, 245, 245, 0.75);
  --vidrio: rgba(255, 255, 255, 0.10);
  --vidrio-borde: rgba(255, 255, 255, 0.22);
  --sombra: rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color: var(--texto);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ---------- Fondo animado en tonos rojos ---------- */
.fondo-animado {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(120deg, var(--rojo-4), var(--rojo-1), var(--rojo-2), var(--rojo-3), var(--rojo-1));
  background-size: 400% 400%;
  animation: mover-gradiente 18s ease infinite;
}

.fondo-animado::before,
.fondo-animado::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: flotar 14s ease-in-out infinite;
}

.fondo-animado::before {
  width: 45vmax;
  height: 45vmax;
  background: radial-gradient(circle, rgba(255, 90, 90, 0.55), transparent 70%);
  top: -10%;
  left: -10%;
}

.fondo-animado::after {
  width: 55vmax;
  height: 55vmax;
  background: radial-gradient(circle, rgba(120, 0, 20, 0.6), transparent 70%);
  bottom: -20%;
  right: -15%;
  animation-delay: -7s;
}

@keyframes mover-gradiente {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes flotar {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4%, 6%) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .fondo-animado, .fondo-animado::before, .fondo-animado::after {
    animation: none;
  }
}

/* Malla ondulada (página pública), tonos rojos */
.fondo-grid-vivo {
  background: #4a0810;
  overflow: hidden;
}

.fondo-grid-vivo::before,
.fondo-grid-vivo::after {
  display: none;
}

.fondo-grid-vivo canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Header ---------- */
.encabezado {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px clamp(16px, 4vw, 40px);
}

.logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--vidrio);
  border: 1px solid var(--vidrio-borde);
}

.logo-fallback {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--vidrio-borde);
  font-weight: 800;
  font-size: 18px;
}

.marca-titulo {
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

.marca {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.marca-subtitulo {
  margin: 0;
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--texto-suave);
}

/* ---------- Contenido principal ---------- */
.contenido-principal {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px clamp(16px, 6vw, 64px) 100px;
  gap: 26px;
}

.titulo-hero {
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  font-weight: 900;
  line-height: 1.03;
  margin: 0;
  text-shadow: 0 6px 30px var(--sombra);
}

.titulo-hero span {
  display: block;
  color: var(--texto);
  -webkit-text-stroke: 1px rgba(255,255,255,0.25);
}

.subtitulo-hero {
  max-width: 540px;
  color: var(--texto-suave);
  font-size: clamp(1rem, 2vw, 1.15rem);
  margin: 0;
}

/* ---------- Botón principal de registro ---------- */
.acciones-registro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-registro {
  appearance: none;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  letter-spacing: 0.02em;
  color: var(--rojo-4);
  background: linear-gradient(135deg, #fff, #ffe1e1);
  padding: 18px 46px;
  border-radius: 100px;
  box-shadow: 0 14px 40px var(--sombra), 0 0 0 6px rgba(255,255,255,0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  min-width: 260px;
}

.btn-registro:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 50px var(--sombra), 0 0 0 8px rgba(255,255,255,0.12);
}

.btn-registro:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.btn-registro:disabled {
  cursor: not-allowed;
  filter: grayscale(0.3) brightness(0.85);
  opacity: 0.85;
}

.btn-registro.contador {
  color: var(--texto);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--vidrio-borde);
  box-shadow: none;
}

.btn-registro.lleno {
  color: var(--texto);
  background: rgba(80, 10, 15, 0.55);
  border: 1px solid rgba(255,255,255,0.2);
}

.detalle-horario {
  color: var(--texto-suave);
  font-size: 0.9rem;
}

.btn-recomendaciones {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer;
  font-weight: 700;
  font-size: clamp(0.82rem, 1.8vw, 0.95rem);
  letter-spacing: 0.02em;
  color: var(--rojo-4);
  background: linear-gradient(135deg, #fff, #ffe1e1);
  padding: 10px 22px;
  border-radius: 100px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  min-width: 170px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-recomendaciones:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}

.btn-lista-espera {
  appearance: none;
  display: inline-block;
  margin: 12px auto 0;
  border: 1px solid #E10113;
  cursor: pointer;
  font-weight: 700;
  font-size: clamp(0.82rem, 1.8vw, 0.95rem);
  letter-spacing: 0.02em;
  color: #fff;
  background: #E10113;
  padding: 10px 22px;
  border-radius: 100px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  min-width: 170px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-lista-espera:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(225, 1, 19, 0.45);
  filter: brightness(1.05);
}

.btn-lista-espera:active {
  transform: translateY(0) scale(0.99);
}

.btn-lista-espera[hidden] {
  display: none;
}

.recomendaciones-texto {
  margin-top: 10px;
  color: var(--texto-suave);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
  white-space: pre-wrap;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 8px;
}

/* ---------- Botón flotante de información ---------- */
.btn-info {
  position: fixed;
  right: clamp(14px, 4vw, 32px);
  bottom: clamp(14px, 4vw, 32px);
  z-index: 20;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--vidrio-borde);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  color: var(--texto);
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--sombra);
  transition: transform 0.18s ease;
}

.btn-info:hover { transform: translateY(-2px) scale(1.05); }

/* ---------- Modales ---------- */
.overlay-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 2, 4, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.overlay-modal[hidden] { display: none; }

.caja-modal {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(160deg, #2b0509, #4a0d13);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
  position: relative;
  color: var(--texto);
  animation: aparecer-modal 0.22s ease;
}

@keyframes aparecer-modal {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cerrar-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--texto);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.caja-modal h3 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.caja-modal p.descripcion {
  margin: 0 0 18px;
  color: var(--texto-suave);
  font-size: 0.92rem;
}

.campo {
  margin-bottom: 16px;
  text-align: left;
}

.campo label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--texto-suave);
}

.campo input,
.campo select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: var(--texto);
  font-size: 1rem;
  font-family: inherit;
}

.campo select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-color: rgba(255,255,255,0.08);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23fff5f5' d='M1.2 1.2L6 6l4.8-4.8'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  cursor: pointer;
}

.campo select option {
  color: #1a0508;
  background: #fff;
}

.campo input::placeholder { color: rgba(255,255,255,0.45); }
.campo input:focus,
.campo select:focus { outline: 2px solid #ffd54d; outline-offset: 1px; }

.campo small.error {
  color: #ffb3b3;
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  min-height: 1em;
}

.btn-enviar {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffe1e1, #fff);
  color: var(--rojo-4);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}

.btn-enviar:disabled { opacity: 0.7; cursor: progress; }

.mensaje-estado {
  margin-top: 14px;
  font-size: 0.88rem;
  text-align: center;
  min-height: 1.2em;
}

.mensaje-estado.exito { color: #a4f0a4; }
.mensaje-estado.espera { color: #ffb347; }
.mensaje-estado.error { color: #ffb3b3; }

.lista-espera {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  text-align: left;
  max-height: 50vh;
  overflow-y: auto;
}

.lista-espera li {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 0.95rem;
}

.lista-horarios {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lista-horarios li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
}

.lista-horarios .dia { font-weight: 700; }
.lista-horarios .vacio { text-align: center; color: var(--texto-suave); padding: 10px; }

.caja-modal-info {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.caja-modal-info h3,
.caja-modal-info .descripcion,
.caja-modal-info .lista-horarios {
  flex-shrink: 0;
}

.reglamento {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.14);
  text-align: left;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow: hidden;
}

.reglamento h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.reglamento-texto {
  color: var(--texto-suave);
  font-size: 0.9rem;
  line-height: 1.45;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 8px;
}

.pie-pagina {
  text-align: center;
  padding: 14px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
}

.tarjeta-cancelar {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(160deg, #2b0509, #4a0d13);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 18px;
  padding: 28px 26px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
}

.tarjeta-cancelar h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.tarjeta-cancelar p {
  margin: 0 0 18px;
  color: var(--texto-suave);
  font-size: 0.95rem;
  line-height: 1.45;
}

.btn-cancelar-asistencia {
  appearance: none;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  background: #c81e2c;
  padding: 12px 22px;
  border-radius: 10px;
}

.btn-cancelar-asistencia:hover { filter: brightness(1.08); }

.enlace-volver {
  color: #ffd5d8;
  font-weight: 700;
  text-decoration: underline;
}
