/*--------------------------------------------------------------
# Encuesta de Halloween (modal de la página principal)
--------------------------------------------------------------*/
:root {
  --enc-blood: #8a0010;
  --enc-red: #e0303c;
  --enc-ink: #efe2e4;
  --enc-muted: #a8979b;
  --enc-card: #0d0507;
  --enc-line: rgba(224, 48, 60, .35);
}

/* Botón flotante */
.enc-fab {
  position: fixed;
  left: 18px;
  bottom: 96px;
  z-index: 996;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 12px;
  border: 1px solid var(--enc-red);
  border-radius: 40px;
  background: linear-gradient(135deg, #1a0508, #000);
  color: var(--enc-ink);
  font: 700 15px "Raleway", sans-serif;
  letter-spacing: .5px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(224, 48, 60, .45);
  animation: enc-pulse 2.4s ease-in-out infinite;
  transition: transform .2s;
}
.enc-fab.show { display: inline-flex; animation: enc-fab-in .6s cubic-bezier(.2, 1.4, .4, 1), enc-pulse 2.4s ease-in-out .6s infinite; }
.enc-fab.solo { bottom: 18px; }
.enc-fab:hover { transform: translateY(-2px) scale(1.04); }
.enc-fab:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.enc-fab .ico { font-size: 22px; line-height: 1; }
.enc-fab .dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--enc-red);
  box-shadow: 0 0 8px var(--enc-red);
}

/* Fondo y tarjeta */
.enc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse at 50% 40%, rgba(60, 0, 8, .55), rgba(0, 0, 0, .88) 70%);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .35s ease;
}
.enc-overlay.open { opacity: 1; }
.enc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 32px);
  border: 1px solid var(--enc-line);
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(138, 0, 16, .35), transparent 60%),
    var(--enc-card);
  color: var(--enc-ink);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 30px 80px rgba(0, 0, 0, .8), 0 0 60px rgba(224, 48, 60, .2);
  transform: translateY(30px) scale(.94);
  filter: blur(6px);
  transition: transform .45s cubic-bezier(.2, 1.2, .4, 1), filter .45s ease;
  overflow: hidden;
}
.enc-overlay.open .enc-card { transform: none; filter: none; }

.enc-head { padding: 18px 22px 12px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.enc-title {
  margin: 0;
  padding-right: 36px;
  font-family: "Creepster", "Raleway", cursive;
  font-weight: 400;
  font-size: 30px;
  letter-spacing: 2px;
  color: var(--enc-red);
  text-shadow: 0 0 14px rgba(224, 48, 60, .5);
}
.enc-preview {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  border: 1px dashed rgba(255, 200, 80, .6);
  border-radius: 20px;
  color: #ffd27a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
}
.enc-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--enc-muted);
  font-size: 22px;
  line-height: 36px;
  cursor: pointer;
  transition: color .2s, background .2s, transform .3s;
}
.enc-close:hover { color: #fff; background: rgba(224, 48, 60, .2); transform: rotate(90deg); }

/* Progreso: una barra que se llena de sangre, con una gota en la punta */
.enc-progress { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--enc-muted); }
.enc-bar { position: relative; flex: 1; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .07); }
.enc-bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, #4a0008, var(--enc-blood), var(--enc-red));
  box-shadow: 0 0 10px rgba(224, 48, 60, .6);
  transition: width .5s cubic-bezier(.3, 1.2, .5, 1);
}
.enc-bar i::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 6px;
  width: 6px;
  height: 9px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--enc-red);
  animation: enc-drip 1.8s ease-in infinite;
}
.enc-step { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Pantallas con transición */
.enc-body { position: relative; flex: 1; min-height: 300px; overflow-x: hidden; overflow-y: auto; }
.enc-slide { padding: 22px; transition: transform .38s cubic-bezier(.3, .9, .4, 1), opacity .3s ease; }
.enc-slide.enter-right { transform: translateX(60px); opacity: 0; }
.enc-slide.enter-left { transform: translateX(-60px); opacity: 0; }
.enc-slide.leave-left { position: absolute; inset: 0 0 auto 0; transform: translateX(-60px); opacity: 0; }
.enc-slide.leave-right { position: absolute; inset: 0 0 auto 0; transform: translateX(60px); opacity: 0; }

.enc-block { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--enc-red); }
.enc-q { margin: 0 0 18px; font: 700 20px/1.35 "Raleway", sans-serif; color: var(--enc-ink); }
.enc-hint { margin: -10px 0 14px; font-size: 13px; color: var(--enc-muted); }

.enc-opts { display: grid; gap: 10px; }
.enc-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  color: var(--enc-ink);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  animation: enc-opt-in .35s ease forwards;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .15s;
}
.enc-opt:hover { border-color: rgba(224, 48, 60, .6); background: rgba(224, 48, 60, .08); }
.enc-opt:active { transform: scale(.98); }
.enc-opt:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.enc-opt .key {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--enc-muted);
  transition: all .2s;
}
.enc-opt.multi .key { border-radius: 50%; }
.enc-opt.sel { border-color: var(--enc-red); background: rgba(224, 48, 60, .14); box-shadow: 0 0 16px rgba(224, 48, 60, .3), inset 0 0 20px rgba(224, 48, 60, .08); }
.enc-opt.sel .key { border-color: var(--enc-red); background: var(--enc-red); color: #fff; }
.enc-opt .ripple {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: rgba(224, 48, 60, .45);
  pointer-events: none;
  animation: enc-ripple .6s ease-out forwards;
}

/* Escala 1-5 con caras */
.enc-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.enc-scale .enc-opt { flex-direction: column; justify-content: center; gap: 6px; padding: 14px 4px; text-align: center; font-size: 13px; }
.enc-scale .emo { font-size: 34px; line-height: 1; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); filter: grayscale(.6); }
.enc-scale .enc-opt:hover .emo, .enc-scale .enc-opt.sel .emo { transform: scale(1.25); filter: none; }

/* 0-10 */
.enc-nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; }
.enc-nps .enc-opt { justify-content: center; padding: 12px 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.enc-nps-legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--enc-muted); }

.enc-input, .enc-text {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #3a1118;
  border-radius: 8px;
  background: #120609;
  color: var(--enc-ink);
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}
.enc-input:focus, .enc-text:focus { outline: none; border-color: var(--enc-red); box-shadow: 0 0 12px rgba(224, 48, 60, .3); }
.enc-text { min-height: 120px; resize: vertical; }
.enc-count { margin-top: 6px; text-align: right; font-size: 12px; color: var(--enc-muted); }
.enc-otro { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.enc-otro.show { max-height: 80px; }

/* Intro y agradecimiento */
.enc-intro, .enc-thanks { text-align: center; }
.enc-intro img, .enc-thanks img { width: 110px; margin: 4px auto 12px; display: block; animation: enc-candle 2.3s infinite, enc-float 3.5s ease-in-out infinite; }
.enc-intro h3, .enc-thanks h3 { margin: 0 0 10px; font: 700 22px "Raleway", sans-serif; }
.enc-intro p, .enc-thanks p { margin: 0 auto 12px; max-width: 470px; color: #cdbfc2; font-size: 15px; line-height: 1.55; }
.enc-intro img { width: 92px; margin-bottom: 8px; }
.enc-intro h3 { font-size: 23px; }
.enc-checks { display: grid; gap: 8px; max-width: 470px; margin: 16px auto; padding: 0; list-style: none; text-align: left; }
.enc-checks li {
  position: relative;
  padding: 10px 12px 10px 44px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  color: #cdbfc2;
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
  transform: translateX(-12px);
  animation: enc-check-in .45s ease forwards;
}
.enc-checks li b { color: var(--enc-ink); }
.enc-checks li::before {
  content: "✓";
  position: absolute;
  left: 12px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--enc-blood);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(224, 48, 60, .5);
}
.enc-cierre { font-size: 14px !important; color: var(--enc-muted) !important; }
@keyframes enc-check-in { to { opacity: 1; transform: none; } }
.enc-thanks h3 { font-family: "Creepster", cursive; font-weight: 400; font-size: 36px; letter-spacing: 2px; color: var(--enc-red); text-shadow: 0 0 16px rgba(224, 48, 60, .6); animation: enc-pop .6s cubic-bezier(.2, 1.6, .4, 1); }

/* Pie */
.enc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid rgba(255, 255, 255, .06); }
.enc-btn {
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: 700 14px "Raleway", sans-serif;
  letter-spacing: .5px;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, opacity .2s, transform .15s;
}
.enc-btn:active { transform: scale(.97); }
.enc-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.enc-btn.primary { background: var(--enc-blood); color: #fff; }
.enc-btn.primary:hover { background: var(--enc-red); box-shadow: 0 0 18px rgba(224, 48, 60, .55); }
.enc-btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .15); color: var(--enc-muted); }
.enc-btn.ghost:hover { color: #fff; border-color: rgba(255, 255, 255, .35); }
.enc-btn[disabled] { opacity: .4; cursor: not-allowed; box-shadow: none; }
.enc-btn.hidden { visibility: hidden; }

.enc-error {
  margin: 0 22px;
  max-height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(224, 48, 60, .15);
  color: #ffd0d4;
  font-size: 14px;
  transition: max-height .3s ease, padding .3s ease, margin .3s ease;
}
.enc-error.show { max-height: 80px; padding: 10px 12px; margin: 0 22px 10px; }
.enc-shake { animation: enc-shake .4s; }

@keyframes enc-pulse { 50% { box-shadow: 0 0 30px rgba(224, 48, 60, .8); } }
@keyframes enc-fab-in { from { opacity: 0; transform: translateX(-40px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes enc-drip {
  0%, 40% { transform: translateY(-4px) scale(.6); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(10px) scale(1); opacity: 0; }
}
@keyframes enc-opt-in { to { opacity: 1; transform: none; } }
@keyframes enc-ripple { to { transform: scale(18); opacity: 0; } }
@keyframes enc-candle {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 110, 0, .7)); }
  35% { filter: drop-shadow(0 0 22px rgba(255, 120, 0, .95)); }
  60% { filter: drop-shadow(0 0 6px rgba(255, 110, 0, .45)); }
}
@keyframes enc-float { 50% { transform: translateY(-8px); } }
@keyframes enc-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes enc-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (max-width: 575px) {
  .enc-fab { bottom: 92px; padding: 10px 14px 10px 10px; font-size: 14px; }
  .enc-title { font-size: 24px; }
  .enc-q { font-size: 17px; }
  .enc-slide { padding: 18px 16px; }
  .enc-head, .enc-foot { padding-left: 16px; padding-right: 16px; }
  .enc-scale .emo { font-size: 26px; }
  .enc-scale .enc-opt span:last-child { font-size: 11px; }
  .enc-nps { grid-template-columns: repeat(6, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .enc-fab, .enc-fab.show, .enc-opt, .enc-checks li, .enc-bar i::after, .enc-intro img, .enc-thanks img, .enc-thanks h3 { animation: none !important; opacity: 1; transform: none; }
  .enc-slide, .enc-card, .enc-overlay { transition: none !important; }
}
