/* 💀🌼 TEMA DE DÍA DE MUERTOS para la pantalla de acceso (`public/index.html`).
   💬 Alexis, 2026-10-27: «quiero hacer un diseño de día de muertos más cool»
      que el de EuroNet (que lleva un murciélago que vuela).

   Lo enciende `js/tema-muertos.js` poniendo la clase `muertos` en <html>: TODO
   aquí cuelga de esa clase, así que esta hoja se puede cargar siempre y no
   cambia nada el resto del año.

   🔴 LAS CAPAS DEL LOGIN (frontend/CLAUDE.md, regla 4-bis) SIGUEN MANDANDO:
      todo lo decorativo va con `pointer-events:none` y `z-index:0` — por DETRÁS
      de la tarjeta (1) y del logotipo (2). La ÚNICA pieza que se puede pulsar es
      la calavera, y vive en una esquina, lejos del formulario, y en pantallas
      estrechas NO se pinta: un botón fijo encima de «Entrar» en un teléfono
      sería justo lo que impide entrar. */

/* ===================== PAPEL PICADO ===================== */
.muertos .mx-papel {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 96px;
  z-index: 0;
  pointer-events: none;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 0 1vw;
}
/* el cordel del que cuelgan */
.muertos .mx-papel::before {
  content: '';
  position: absolute;
  top: 6px; left: 0; right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.muertos .mx-bandera {
  position: relative;
  top: 6px;
  width: 78px;
  height: 88px;
  transform-origin: 50% 0;
  animation: mxMecer 3.6s ease-in-out infinite;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
  opacity: 0.92;
  /* El recorte (bordes en pico, la calavera calada, los rombos) es una
     máscara: lo blanco se queda y lo vacío deja ver el fondo, como el papel
     de china picado de verdad. */
  -webkit-mask: var(--mx-mascara) center / 100% 100% no-repeat;
          mask: var(--mx-mascara) center / 100% 100% no-repeat;
}
@keyframes mxMecer {
  0%, 100% { transform: rotate(-4deg) skewX(2deg); }
  50%      { transform: rotate(4deg)  skewX(-2deg); }
}

/* ===================== VELADORAS ===================== */
.muertos .mx-velas {
  position: fixed;
  left: 2.5vw;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.muertos .mx-vela {
  position: relative;
  width: 34px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(90deg, #f3e3c3, #fff7e6 45%, #e4cfa6);
  box-shadow: inset 0 -10px 16px rgba(160, 90, 20, 0.25);
}
.muertos .mx-vela:nth-child(1) { height: 70px; }
.muertos .mx-vela:nth-child(2) { height: 104px; }
.muertos .mx-vela:nth-child(3) { height: 54px; }
/* el pabilo */
.muertos .mx-vela::before {
  content: '';
  position: absolute;
  left: 50%; top: -9px;
  width: 2px; height: 10px;
  margin-left: -1px;
  background: #3b2a1a;
}
/* el halo que ilumina alrededor */
.muertos .mx-vela::after {
  content: '';
  position: absolute;
  left: 50%; top: -60px;
  width: 140px; height: 140px;
  margin-left: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 170, 60, 0.38), rgba(255, 140, 0, 0) 65%);
  animation: mxHalo 2.3s ease-in-out infinite;
}
.muertos .mx-flama {
  position: absolute;
  left: 50%; top: -34px;
  width: 16px; height: 26px;
  margin-left: -8px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 72%, #fff6c8 0 22%, #ffc233 45%, #ff7b00 78%, rgba(255, 90, 0, 0) 100%);
  transform-origin: 50% 90%;
  animation: mxFlama 0.9s ease-in-out infinite alternate;
  filter: blur(0.4px);
}
.muertos .mx-vela:nth-child(2) .mx-flama { animation-delay: -0.35s; }
.muertos .mx-vela:nth-child(3) .mx-flama { animation-delay: -0.6s; }
@keyframes mxFlama {
  0%   { transform: scale(1, 1) rotate(-3deg); }
  40%  { transform: scale(0.92, 1.1) rotate(2deg); }
  100% { transform: scale(1.05, 0.94) rotate(-1deg); }
}
@keyframes mxHalo {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.08); }
}

/* ===================== PÉTALOS DE CEMPASÚCHIL ===================== */
.muertos .mx-petalos {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ===================== SÓLO EL LOGIN, SIN LA FOTO ===================== */
/* 💬 Alexis, 2026-10-27: «hay que quitar por esta temporada la imagen que está
   al lado del login, deja el puro login». Sólo mientras dura el tema: el resto
   del año vuelve la foto que se sube desde /perfil/admin. */
.muertos .image-panel { display: none; }
.muertos .container { width: 440px; }

/* ===================== LA TARJETA ES UNA HOJA DE PAPEL PICADO ===================== */
/* 💬 Alexis, 2026-10-28: «en lugar de la calavera, mejor algo de papel picado».
   La tarjeta deja de ser un cristal y pasa a ser el dibujo (js: papelDelLogin()).
   El relleno del formulario está medido para que el título caiga bajo la
   calavera calada y los campos en la parte lisa de la hoja: si se toca una
   medida, mira el conjunto. */
.mx-op1 .container {
  width: 420px;
  max-width: 94vw;
  height: 540px;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.muertos .mx-papel-login {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 16px rgba(255, 120, 200, 0.3)) drop-shadow(0 12px 16px rgba(0, 0, 0, 0.6));
}
.muertos .mx-papel-login svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mx-op1 .login-panel {
  position: relative;
  z-index: 1;
  padding: 160px 66px 110px;
  justify-content: flex-start;
}
/* el logotipo, más grande (Alexis, 2026-10-28) — en los dos diseños */
.muertos .logo-login { width: 540px; max-width: 90vw; }   /* el PNG trae margen transparente: a 400 se veía casi igual que antes */
.muertos .titulo-principal { margin-bottom: 6px; }

/* ===================== LA LETRA Y EL CENTRADO DEL LOGIN ===================== */
/* 💬 Alexis, 2026-10-27: «una letra en el login y contraseña más tipo de
   Halloween, y céntralas». Creepster (Google Fonts, la carga el JS sólo con el
   tema). ⚠️ En los campos va MÁS GRANDE y con espacio entre letras: es una letra
   que escurre, y a 16px un usuario como «rola98» se lee mal. */
.muertos .login-panel { align-items: center; text-align: center; }
.muertos .login-panel form { width: 100%; display: flex; flex-direction: column; align-items: center; }
.muertos .login-panel h2 {
  font-family: 'Creepster', 'Corpo S', sans-serif;
  font-size: 2em;
  font-weight: normal;
  letter-spacing: 0.06em;
  /* va sobre el papel magenta: blanco con sombra y un halo cempasúchil */
  color: #fff;
  text-shadow: 0 2px 3px rgba(60, 0, 30, 0.7), 0 0 10px rgba(255, 170, 60, 0.55);
  margin-bottom: 10px;
}
.muertos .login-panel input {
  font-family: 'Creepster', 'Corpo S', sans-serif;
  font-size: 1.3em;
  letter-spacing: 0.08em;
  text-align: center;
  color: #3b0a45;
  padding: 8px 10px;
  margin-bottom: 12px;
  border: 2px solid #3a1f4d;
}
.muertos .login-panel input::placeholder {
  font-family: 'Creepster', 'Corpo S', sans-serif;
  color: #9b6a3a;
  letter-spacing: 0.08em;
}
.muertos .login-panel button {
  font-family: 'Creepster', 'Corpo S', sans-serif;
  font-size: 1.5em;
  letter-spacing: 0.1em;
  padding: 8px 34px;
  background: linear-gradient(#ff9f1c, #e85d04);
  color: #2b0a12;
  box-shadow: 0 0 14px rgba(255, 140, 0, 0.5);
}

/* ===================== LA HILERA DE CEMPASÚCHIL ===================== */
.muertos .mx-flores svg { display: block; }
/* quietas a propósito (Alexis, 2026-10-27: «el cempasúchil sin movimiento») */
/* las veladoras se apoyan SOBRE las flores, no detrás */
.muertos .mx-velas { bottom: 44px; z-index: 0; }

/* ===================== LA NOCHE (oscurece; el puntero alumbra) ===================== */
/* z-index 0 y añadida DESPUÉS de lo decorativo: tapa el fondo, nunca la tarjeta
   (1) ni el logotipo (2). pointer-events:none o nadie podría entrar. */
.muertos .mx-noche {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ===================== LA CALAVERA (la única que se pulsa) ===================== */
.muertos .mx-calavera {
  position: fixed;
  right: 3vw;
  bottom: 22px;
  z-index: 5;
  width: 118px;
  height: 138px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 0 14px rgba(255, 160, 40, 0.55)) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
  animation: mxFlotar 4.5s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.muertos .mx-calavera:focus-visible {
  outline: 3px solid #ffb703;
  outline-offset: 6px;
  border-radius: 50%;
}
.muertos .mx-calavera svg { width: 100%; height: 100%; display: block; overflow: visible; }
.muertos .mx-calavera:hover { animation-play-state: paused; }
.muertos .mx-calavera:hover svg { transform: rotate(-6deg) scale(1.05); }
.muertos .mx-calavera svg { transition: transform 0.25s ease; }
.muertos .mx-pupila { transition: transform 0.12s linear; }
.muertos .mx-brillo { animation: mxPupila 2.6s ease-in-out infinite; }
.muertos .mx-mandibula { transition: transform 0.1s; }
.muertos .mx-calavera.mx-habla .mx-mandibula { animation: mxCastanea 0.18s ease-in-out 6 alternate; }
@keyframes mxFlotar {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}
@keyframes mxCastanea {
  from { transform: translateY(0); }
  to   { transform: translateY(7px); }
}
@keyframes mxPupila {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* el globo con la calaverita */
.muertos .mx-globo {
  position: fixed;
  right: calc(3vw + 20px);
  bottom: 176px;
  z-index: 5;
  max-width: 290px;
  padding: 14px 18px 14px;
  border-radius: 14px;
  background: rgba(30, 8, 40, 0.92);
  border: 2px solid #ff8c00;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 140, 0, 0.35);
  color: #fff4e0;
  font: 15px/1.45 'Corpo S', Georgia, serif;
  white-space: pre-line;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.muertos .mx-globo::after {
  content: '';
  position: absolute;
  right: 42px; bottom: -11px;
  border: 10px solid transparent;
  border-top-color: #ff8c00;
  border-bottom: 0;
}
.muertos .mx-globo.mx-visible { opacity: 1; transform: none; }
.muertos .mx-globo b {
  display: block;
  margin-bottom: 4px;
  color: #ffb703;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===================== PANTALLAS ESTRECHAS ===================== */
/* En un teléfono la calavera y las velas tapan el formulario: fuera. El papel
   picado se encoge y los pétalos se quedan (no se pueden pulsar). */
@media (max-width: 760px) {
  .muertos .mx-calavera,
  .muertos .mx-globo,
  .muertos .mx-velas { display: none; }
  .muertos .mx-papel { height: 64px; }
  .muertos .mx-bandera { width: 46px; height: 54px; }
}
@media (max-height: 560px) {
  .muertos .mx-velas { display: none; }
}

/* ===================== SIN MOVIMIENTO ===================== */
@media (prefers-reduced-motion: reduce) {
  .muertos .mx-bandera,
  .muertos .mx-flama,
  .muertos .mx-vela::after,
  .muertos .mx-calavera,
  .muertos .mx-brillo { animation: none; }
}

/* =====================================================================
   🌕 OPCIÓN 2 — EL PANTEÓN (`/?tema=muertos2`). Lo pinta opcionDos() y
   mariposas() en js/tema-muertos.js. Todo cuelga de `.mx-op2`.
   ===================================================================== */
.mx-op2 .mx-cielo {
  background: linear-gradient(180deg, #07021a 0%, #170533 52%, #3b0c3f 100%);
}
.mx-op2 .mx-estrella {
  position: absolute;
  border-radius: 50%;
  background: #fff7e0;
  box-shadow: 0 0 4px rgba(255, 247, 224, 0.9);
  animation: mxTitila 3s ease-in-out infinite;
}
@keyframes mxTitila {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}
.mx-op2 .mx-luna {
  position: absolute;
  top: 7vh;
  right: 8vw;
  width: min(190px, 26vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 38%, rgba(190, 110, 40, 0.35) 0 9%, transparent 10%),
    radial-gradient(circle at 62% 62%, rgba(190, 110, 40, 0.3) 0 7%, transparent 8%),
    radial-gradient(circle at 58% 28%, rgba(190, 110, 40, 0.25) 0 5%, transparent 6%),
    radial-gradient(circle at 40% 35%, #fff6d6, #ffd58a 55%, #f4a261 100%);
  box-shadow: 0 0 60px 18px rgba(255, 190, 100, 0.35), 0 0 180px 70px rgba(255, 140, 60, 0.16);
}
.mx-op2 .mx-panteon {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 26vh;
}
.mx-op2 .mx-velita {
  filter: drop-shadow(0 0 4px #ff9f1c);
  animation: mxVelita 1.6s ease-in-out infinite alternate;
}
@keyframes mxVelita {
  from { opacity: 0.55; }
  to   { opacity: 1; }
}

/* el login ES la ofrenda */
.mx-op2 .container {
  width: 430px;
  max-width: 88vw;
  margin-top: 110px;
  background: linear-gradient(180deg, rgba(48, 12, 70, 0.82), rgba(22, 4, 36, 0.9));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 183, 3, 0.75);
  border-radius: 26px;
  box-shadow: 0 0 0 6px rgba(228, 0, 124, 0.22), 0 0 44px rgba(255, 140, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.65);
  overflow: visible;
}
.mx-op2 .login-panel {
  position: relative;
  z-index: 1;
  padding: 50px 54px 42px;
}
.mx-op2 .login-panel h2 { color: #ffd166; }
.mx-op2 .login-panel button {
  background: linear-gradient(#ff4fae, #c2006f);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 60, 170, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.mx-op2 .mx-arco {
  position: absolute;
  left: -86px; right: -86px;
  top: -128px;
  height: 210px;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}
.mx-op2 .mx-arco svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mx-op2 .mx-cirio {
  position: absolute;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
}
.mx-op2 .mx-cirio.izq { left: -64px; }
.mx-op2 .mx-cirio.der { right: -64px; }
.mx-op2 .logo-login { width: 460px; }

@media (max-width: 760px) {
  .mx-op2 .mx-cirio { display: none; }
  .mx-op2 .mx-arco { left: -26px; right: -26px; top: -84px; height: 140px; }
  .mx-op2 .container { margin-top: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .mx-op2 .mx-estrella,
  .mx-op2 .mx-velita { animation: none; }
}

/* =====================================================================
   🗂️ OPCIÓN 3 — LA SOBRIA (`/?tema=muertos3`): la tarjeta del login de
   EuroNet (medida sobre su página: 428 px, radio 16, relleno 40/40/36,
   campos de 48 px con el icono dentro, Manrope) y Día de Muertos en los
   detalles. Lo pinta opcionTres(). Todo cuelga de `.mx-op3`.
   ⚠️ Pisa a propósito la letra de miedo de `.muertos` (título, campos y
      botón): por eso estas reglas van al FINAL de la hoja.
   ===================================================================== */
.mx-op3 body {
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 140, 0, 0.22), transparent 34%),
    radial-gradient(circle at 10% 92%, rgba(228, 0, 124, 0.18), transparent 36%),
    radial-gradient(circle at 50% 40%, #1a1035, #07040f 75%);
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
}
.mx-op3 body::before { opacity: 0.05; }
.mx-op3 .mx-papel--fino { height: 58px; }
.mx-op3 .mx-papel--fino .mx-bandera { width: 44px; height: 52px; opacity: 0.85; }
.mx-op3 .logo-login { width: 420px; }
.mx-op3 .titulo-principal { margin-bottom: 18px; }

.mx-op3 .container {
  width: 428px;
  max-width: 94vw;
  background: #fff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid #e1e6ee;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(30, 45, 80, 0.06), 0 30px 60px -20px rgba(0, 0, 0, 0.6), 0 0 50px rgba(255, 140, 0, 0.18);
  overflow: visible;
}
/* el filete de colores de papel picado, arriba de la tarjeta */
.mx-op3 .container::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, #e4007c, #ff8c00 25%, #ffd60a 45%, #2dc653 62%, #00b4d8 80%, #7b2cbf);
}
.mx-op3 .mx3-flor {
  position: absolute;
  top: -26px; right: -24px;
  width: 64px; height: 64px;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}
.mx-op3 .mx3-flor svg { width: 100%; height: 100%; overflow: visible; }

.mx-op3 .login-panel {
  padding: 40px 40px 36px;
  align-items: stretch;
  text-align: left;
  color: #2b3542;
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
}
.mx-op3 .login-panel form { align-items: stretch; }
.mx-op3 .mx3-chip {
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff3e6;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.mx-op3 .mx3-chip::before { content: '🌼 '; }
.mx-op3 .login-panel h2 {
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  font-size: 25.6px;
  font-weight: 600;
  letter-spacing: 0;
  color: #0f1720;
  text-shadow: none;
  margin: 0 0 6px;
  text-align: left;
}
.mx-op3 .mx3-lead {
  margin: 0 0 24px;
  color: #5b6675;
  font-size: 15px;
  line-height: 1.45;
}
.mx-op3 .mx3-campo { margin-bottom: 16px; }
.mx-op3 .mx3-campo label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #0f1720;
}
.mx-op3 .mx3-entrada { position: relative; }
.mx-op3 .mx3-icono {
  position: absolute;
  left: 14px; top: 50%;
  width: 18px; height: 18px;
  margin-top: -9px;
  color: #7a8596;
  pointer-events: none;
}
.mx-op3 .mx3-icono svg, .mx-op3 .mx3-ojo svg { width: 100%; height: 100%; display: block; }
.mx-op3 .login-panel input {
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 44px 0 42px;
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  font-size: 15.4px;
  letter-spacing: 0;
  text-align: left;
  color: #0f1720;
  background: #f7f9fc;
  border: 1px solid #cdd5e1;
  border-radius: 9.6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mx-op3 .login-panel input:focus {
  outline: none;
  border-color: #ff8c00;
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.2);
  background: #fff;
}
.mx-op3 .login-panel input::placeholder {
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  color: #9aa4b2;
  letter-spacing: 0;
}
.mx-op3 .login-panel .mx3-ojo {   /* (0,3,0): tiene que ganarle a `.muertos .login-panel button` */
  position: absolute;
  right: 10px; top: 50%;
  width: 28px; height: 28px;
  margin-top: -14px;
  padding: 5px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #7a8596;
  cursor: pointer;
  box-shadow: none;
  text-shadow: none;
}
.mx-op3 .login-panel .mx3-ojo:hover, .mx-op3 .login-panel .mx3-ojo--abierto { color: #c2410c; background: #fff3e6; }
.mx-op3 .login-panel button[type="submit"] {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0;
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  color: #fff;
  background: linear-gradient(135deg, #f97316, #e4007c);
  border-radius: 9.6px;
  box-shadow: 0 10px 20px -10px rgba(228, 0, 124, 0.7);
  text-shadow: none;
}
.mx-op3 .login-panel button[type="submit"]:hover { filter: brightness(1.06); }
.mx-op3 .mx3-pie {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
}
@media (max-width: 760px) {
  .mx-op3 .login-panel { padding: 32px 22px 28px; }
  .mx-op3 .mx3-flor { right: -8px; top: -22px; width: 50px; height: 50px; }
}
