/* ==========================================================================
   Confesionario (usa los colores y tipografías de estilos.css)
   ========================================================================== */
[hidden] { display: none !important; }
.confesionario { max-width: 560px; }
.conf-intro { max-width: 34ch; margin: 12px auto 0; text-align: center; font-size: 1.02rem; line-height: 1.5; color: rgba(246, 239, 226, .92); text-shadow: 0 1px 8px rgba(4, 10, 40, .8); }
.conf-intro .remate { color: #fff; }

.conf-tarjeta {
  width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 18px;
  padding: 22px 20px; border-radius: 28px;
  background: linear-gradient(160deg, rgba(44, 79, 168, .58), rgba(14, 29, 82, .86));
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .35), 0 18px 50px rgba(2, 6, 28, .5);
}

/* Cerrado */
.conf-cerrado { display: none; width: 100%; box-sizing: border-box; padding: 18px; border-radius: 20px; text-align: center; background: rgba(244, 207, 85, .14); border: 1px solid rgba(244, 207, 85, .45); }
.confesionario[data-abierto="0"] .conf-cerrado { display: block; }
.confesionario[data-abierto="0"] #conf-form { display: none; }

/* Tipos */
.conf-tipos { border: 0; margin: 0; padding: 0; min-width: 0; }
.conf-tipos legend { font-weight: 700; font-size: .92rem; margin-bottom: 10px; }
.chips-tipo { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-tipo { position: relative; cursor: pointer; }
.chip-tipo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-tipo span {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 15px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(5, 12, 40, .45);
  font-weight: 700; font-size: .92rem; transition: background .15s ease, color .15s ease;
}
.chip-tipo input:checked + span { background: var(--hueso); color: #0e1d52; border-color: var(--hueso); }
.chip-tipo input:focus-visible + span { outline: 3px solid var(--estrella); outline-offset: 2px; }
.tipo-desc { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(5, 12, 40, .45); font-size: .88rem; color: rgba(246, 239, 226, .85); }
.tipo-desc:empty { display: none; }
.tipo-desc strong { color: var(--hueso); }

/* Campos */
.conf-campo { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-weight: 700; font-size: .92rem; }
.conf-campo em { font-style: normal; font-weight: 400; color: rgba(246, 239, 226, .6); }
.conf-datos .conf-campo em { display: block; font-size: .85rem; }
.conf-campo textarea, .conf-campo input {
  width: 100%; box-sizing: border-box; min-width: 0; padding: 12px 14px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(5, 12, 40, .6); color: var(--hueso);
  font: inherit; font-weight: 400; font-size: 1rem;
}
.conf-campo textarea { min-height: 200px; line-height: 1.5; resize: vertical; border-radius: 16px; }
.conf-campo input { min-height: 46px; }
.conf-campo textarea::placeholder, .conf-campo input::placeholder { color: rgba(246, 239, 226, .45); }
.conf-campo textarea:focus, .conf-campo input:focus { outline: none; border-color: var(--estrella); box-shadow: 0 0 0 3px rgba(244, 207, 85, .22); }
.conf-contador { align-self: flex-end; font-weight: 400; font-size: .78rem; color: rgba(246, 239, 226, .65); font-variant-numeric: tabular-nums; }
.conf-contador.cerca { color: var(--estrella); }
.conf-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.conf-datos[data-columnas="1"] { grid-template-columns: minmax(0, 1fr); }
.conf-nota { margin: -8px 0 0; font-size: .8rem; color: rgba(246, 239, 226, .7); }
.conf-nota strong { color: var(--hueso); }
.conf-check { display: flex; gap: 14px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 16px; background: rgba(5, 12, 40, .4); border: 1px solid rgba(255, 255, 255, .14); font-size: .92rem; line-height: 1.4; cursor: pointer; }
.conf-check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--kick); }
.conf-check span span { display: block; color: rgba(246, 239, 226, .75); }
.conf-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.conf-turnstile:empty { display: none; }
.conf-error { margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(236, 106, 92, .18); border: 1px solid rgba(236, 106, 92, .5); }
.vidrio.conf-enviar { width: 100%; min-height: 58px; font: inherit; cursor: pointer; justify-content: center; }
.conf-enviar .icono { width: 20px; height: 20px; color: var(--kick); }
.conf-enviar:disabled { opacity: .6; cursor: wait; }
.conf-privacidad { margin: -6px 0 0; text-align: center; font-size: .8rem; color: rgba(246, 239, 226, .7); }

/* Gracias */
.conf-gracias { align-items: center; text-align: center; padding: 30px 22px 24px; }
.conf-gracias .nombre { font-size: 2rem; margin: 4px 0 0; }
.conf-gracias > p { margin: 0; max-width: 30ch; color: rgba(246, 239, 226, .9); }
.conf-gracias-icono { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: rgba(83, 252, 24, .14); border: 2px solid rgba(83, 252, 24, .6); box-shadow: 0 0 30px rgba(83, 252, 24, .3); }
.conf-gracias-icono .icono { width: 36px; height: 36px; color: var(--kick); stroke-width: 2.6; }
.conf-resumen { width: 100%; box-sizing: border-box; margin: 6px 0 0; padding: 14px 16px; border-radius: 18px; background: rgba(5, 12, 40, .5); border: 1px solid rgba(255, 255, 255, .12); display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.conf-resumen div { display: flex; justify-content: space-between; gap: 10px; }
.conf-resumen dt { color: rgba(246, 239, 226, .65); }
.conf-resumen dd { margin: 0; font-weight: 700; }
.conf-gracias-botones { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.conf-gracias-botones .vidrio { width: 100%; box-sizing: border-box; font: inherit; cursor: pointer; justify-content: center; }

/* Consejos */
.conf-consejos { width: 100%; box-sizing: border-box; margin-top: 18px; padding: 20px 18px; border-radius: 24px; background: rgba(5, 12, 40, .6); border: 1px solid rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.conf-consejos h2 { margin: 0 0 14px; font-family: "Caprasimo", Georgia, serif; font-weight: 400; font-size: 1.4rem; color: #fff; }
.conf-tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.conf-tips li { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; line-height: 1.45; text-align: left; }
.conf-tips strong { display: block; font-size: .95rem; color: #fff; }
.conf-tips li > span:last-child > span { color: rgba(246, 239, 226, .82); }
.tip-icono { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(244, 207, 85, .14); border: 1px solid rgba(244, 207, 85, .35); }
.tip-icono .icono { width: 18px; height: 18px; color: var(--estrella); }
.conf-ayuda { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .82rem; line-height: 1.45; color: rgba(246, 239, 226, .8); }
.conf-tips:empty + .conf-ayuda { margin-top: 0; padding-top: 0; border-top: 0; }

@media (max-width: 420px) {
  .conf-tarjeta { padding: 20px 16px; }
}

/* ---------- Animaciones del confesionario ---------- */
.chip-tipo span { transition: background .2s ease, color .2s ease, border-color .2s ease, scale .35s var(--resorte); }
.chip-tipo:hover span { border-color: rgba(255, 255, 255, .5); }
.chip-tipo input:checked + span { animation: elegir .4s var(--resorte); }
@keyframes elegir { 0% { scale: .92; } 60% { scale: 1.06; } 100% { scale: 1; } }
.tipo-desc.cambio { animation: aclarar .35s ease; }
@keyframes aclarar { from { opacity: 0; translate: 0 -4px; } to { opacity: 1; translate: 0 0; } }
.conf-contador { transition: color .2s ease; }

/* "¡Me llegó!": el círculo aparece, la palomita se dibuja y lo demás sube */
.conf-gracias:not([hidden]) { animation: subir .5s cubic-bezier(.2, .8, .2, 1) backwards; }
.conf-gracias:not([hidden]) .conf-gracias-icono { animation: asomar .6s var(--resorte) .1s backwards; }
.conf-gracias:not([hidden]) .conf-gracias-icono .icono { stroke-dasharray: 21; animation: dibujar .45s ease-out .45s backwards; }
@keyframes dibujar { from { stroke-dashoffset: 21; } to { stroke-dashoffset: 0; } }
.conf-gracias:not([hidden]) > :not(.conf-gracias-icono) { animation: subir .5s cubic-bezier(.2, .8, .2, 1) backwards; }
.conf-gracias:not([hidden]) > :nth-child(2) { animation-delay: .3s; }
.conf-gracias:not([hidden]) > :nth-child(3) { animation-delay: .38s; }
.conf-gracias:not([hidden]) > :nth-child(4) { animation-delay: .46s; }
.conf-gracias:not([hidden]) > :nth-child(5) { animation-delay: .54s; }

@media (prefers-reduced-motion: reduce) {
  .chip-tipo input:checked + span, .tipo-desc.cambio, .conf-gracias, .conf-gracias *, .conf-gracias-icono .icono { animation: none !important; }
}

/* ---------- La historia se vuelve estrella ---------- */
.carta-vuela {
  position: fixed; z-index: 80; pointer-events: none; overflow: hidden;
  background: #f6efe2;
  box-shadow: 0 14px 40px rgba(4, 10, 40, .5), 0 0 0 1px rgba(255, 255, 255, .6) inset;
}
.carta-hoja {
  position: absolute; inset: 14% 12% 14%;
  background: repeating-linear-gradient(180deg, transparent 0 9px, rgba(14, 29, 82, .18) 9px 10.5px);
  transition: opacity .25s ease;
}
.carta-solapa {
  position: absolute; left: 0; right: 0; top: 0; height: 58%;
  background: linear-gradient(180deg, #ece0c6, #e3d4b3);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 2px rgba(14, 29, 82, .25));
  transform-origin: 50% 0; scale: 1 0; opacity: 0;
}
.carta-sello {
  position: absolute; left: 50%; top: 58%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  background: radial-gradient(circle, #fff6cf 0 20%, #f4cf55 45%, #d9a92a 70%);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  scale: 0;
}
.carta-vuela.cerrada .carta-hoja { opacity: 0; }
.carta-vuela.cerrada .carta-solapa { animation: cerrarSolapa .3s ease-out forwards; }
.carta-vuela.cerrada .carta-sello { animation: sellar .4s var(--resorte) .22s forwards; }
@keyframes cerrarSolapa { from { scale: 1 -1; opacity: 1; } to { scale: 1 1; opacity: 1; } }
@keyframes sellar { from { scale: 0; rotate: -40deg; } to { scale: 1; rotate: 0deg; } }

.estrella-nueva {
  position: fixed; z-index: 70; width: 46px; height: 46px; margin: -23px 0 0 -23px; pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(255, 226, 140, .95));
  background:
    radial-gradient(circle, #fffbe8 0 9%, rgba(255, 226, 140, .85) 18%, rgba(255, 226, 140, .25) 32%, transparent 50%),
    linear-gradient(90deg, transparent, rgba(255, 244, 200, .95) 50%, transparent) center / 100% 2px no-repeat,
    linear-gradient(0deg, transparent, rgba(255, 244, 200, .95) 50%, transparent) center / 2px 100% no-repeat;
  animation: nuevaEstrella 5s ease-in-out forwards;
}
@keyframes nuevaEstrella {
  0%   { scale: 2.2; opacity: 1; rotate: 0deg; }
  15%  { scale: 1; }
  35%  { scale: .7; opacity: .7; rotate: 45deg; }
  55%  { scale: 1.1; opacity: 1; rotate: 45deg; }
  75%  { scale: .8; opacity: .8; }
  100% { scale: .6; opacity: 0; rotate: 90deg; }
}
.fugaz-carta {
  position: fixed; z-index: 69; width: 140px; height: 2px; margin-top: -1px; pointer-events: none; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 248, 220, 1), rgba(255, 236, 170, .5) 30%, transparent);
  box-shadow: 0 0 6px rgba(255, 240, 190, .7);
  transform-origin: 0 50%; rotate: 160deg; opacity: 0;
  animation: fugazCarta 1.1s cubic-bezier(.35, 0, .6, 1) 1.6s forwards;
}
@keyframes fugazCarta {
  0%   { opacity: 0; translate: 0 0; scale: .2 1; }
  15%  { opacity: 1; scale: 1 1; }
  100% { opacity: 0; translate: -30vw 11vw; scale: .5 1; }
}
