/* /formularios/formulario.css */

/* IMPORTANTE:
   Hacemos html y body transparentes para que el fondo lo ponga
   la página padre que contiene el iframe.
*/
html {
    margin: 0;
    padding: 0;
    background: transparent !important;

    /* Evitar scroll dentro del iframe */
    overflow: hidden !important;
    height: auto !important;
}

body {
    margin: 0;
    padding: 0.75rem;
    background: transparent !important;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 0.95rem;

    /* Evitar scroll dentro del iframe */
    overflow: hidden !important;
    height: auto !important;
}

.formulario-container {
    max-width: 720px;
    margin: 0 auto;
}

.campo-ayuda {
    font-size: 0.8rem;
    color: #666;
}

.slider-control {
    height: 0.6rem;
}

.slider-value-badge {
    font-size: 0.8rem;
    min-width: 80px;
    text-align: center;
}

/* Teléfono: dropdown (bandera + +código) + campo que se adapta al placeholder */
.telefono-input-group .telefono-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

.telefono-codigo-text {
    font-size: 0.85rem;
    margin-left: 0.35rem;
}

.telefono-numero-input {
    flex: 1 1 auto;
}

/* Slider con botones +/- */
.slider-range-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-range-wrapper .btn {
    padding: 0.25rem 0.45rem;
}

/* Fondo transparente para todo el formulario embebido
   (ahora es redundante, pero no estorba si ya lo usas en el body)
*/
.formulario-bg-transparente {
    background: transparent !important;
}

/* ===========================
   Bloque Validar WhatsApp
   =========================== */

.validar_whats_wrapper {
    min-height: 100vh;
    padding: 24px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #f5f7ff 0, #f0f2f8 40%, #e8edf7 100%);
}

.validar_whats_card {
    max-width: 420px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    padding: 26px 22px 24px;
    text-align: center;
}

.validar_whats_title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
}

.validar_whats_text {
    margin: 0 0 20px;
    font-size: 0.95rem;
    color: #4b5563;
}

.validar_whats_form {
    margin: 0;
}

.validar_whats_input_group {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.validar_whats_code_input {
    flex: 1 1 auto;
    max-width: 180px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 1.05rem;
    text-align: center;
    letter-spacing: 0.25em;
    font-weight: 600;
    color: #111827;
    outline: none;
    background-color: #f9fafb;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.validar_whats_code_input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
    background-color: #ffffff;
}

.validar_whats_code_input_error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
    background-color: #fef2f2 !important;
}

.validar_whats_submit_btn {
    flex: 0 0 auto;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 10px 25px rgba(22, 163, 74, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.validar_whats_submit_btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(22, 163, 74, 0.4);
    filter: brightness(1.03);
}

.validar_whats_submit_btn:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px rgba(22, 163, 74, 0.35);
}

.validar_whats_help_text {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ===========================
   Bloque Gracias + Confeti
   =========================== */

.gracias_wrapper {
    min-height: 100vh;
    padding: 24px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #ecfeff 0, #e0f2fe 42%, #eef2ff 100%);
}

.gracias_card {
    max-width: 460px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 55px rgba(30, 64, 175, 0.18);
    padding: 28px 24px 26px;
    text-align: center;
}

.gracias_title {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

.gracias_text {
    margin: 0 0 6px;
    font-size: 0.98rem;
    color: #374151;
}

.gracias_subtext {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Contenedor para las piezas de confeti */
.gracias_confetti_container {
    pointer-events: none;
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 999;
}

/* Piezas de confeti */
.gracias_confetti_piece {
    position: absolute;
    top: -10vh;
    width: 8px;
    height: 16px;
    border-radius: 3px;
    opacity: 0;
    animation-name: gracias_confetti_fall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

/* Colores y variaciones (se combinan por nth-child) */
.gracias_confetti_piece_0,
.gracias_confetti_piece_5 {
    background-color: #ef4444;
}
.gracias_confetti_piece_1,
.gracias_confetti_piece_6 {
    background-color: #22c55e;
}
.gracias_confetti_piece_2,
.gracias_confetti_piece_7 {
    background-color: #3b82f6;
}
.gracias_confetti_piece_3,
.gracias_confetti_piece_8 {
    background-color: #f97316;
}
.gracias_confetti_piece_4,
.gracias_confetti_piece_9 {
    background-color: #a855f7;
}

/* Distribución horizontal y tiempos usando patrones */
.gracias_confetti_piece:nth-child(10n + 1) {
    left: 5%;
    animation-duration: 3.4s;
    animation-delay: 0s;
}
.gracias_confetti_piece:nth-child(10n + 2) {
    left: 15%;
    animation-duration: 3.1s;
    animation-delay: 0.2s;
}
.gracias_confetti_piece:nth-child(10n + 3) {
    left: 25%;
    animation-duration: 3.6s;
    animation-delay: 0.4s;
}
.gracias_confetti_piece:nth-child(10n + 4) {
    left: 35%;
    animation-duration: 3.2s;
    animation-delay: 0.1s;
}
.gracias_confetti_piece:nth-child(10n + 5) {
    left: 45%;
    animation-duration: 3.8s;
    animation-delay: 0.5s;
}
.gracias_confetti_piece:nth-child(10n + 6) {
    left: 55%;
    animation-duration: 3.3s;
    animation-delay: 0.15s;
}
.gracias_confetti_piece:nth-child(10n + 7) {
    left: 65%;
    animation-duration: 3.7s;
    animation-delay: 0.35s;
}
.gracias_confetti_piece:nth-child(10n + 8) {
    left: 75%;
    animation-duration: 3.5s;
    animation-delay: 0.25s;
}
.gracias_confetti_piece:nth-child(10n + 9) {
    left: 85%;
    animation-duration: 3.9s;
    animation-delay: 0.45s;
}
.gracias_confetti_piece:nth-child(10n) {
    left: 95%;
    animation-duration: 3.2s;
    animation-delay: 0.3s;
}

/* Animación de caída del confeti */
@keyframes gracias_confetti_fall {
    0% {
        transform: translate3d(0, 0, 0) rotateZ(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translate3d(0, 110vh, 0) rotateZ(260deg);
        opacity: 0;
    }
}

/* Ajustes responsivos */
@media (max-width: 480px) {
    .validar_whats_card,
    .gracias_card {
        padding: 22px 18px 20px;
        border-radius: 14px;
        box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
    }

    .validar_whats_title,
    .gracias_title {
        font-size: 1.25rem;
    }

    .validar_whats_input_group {
        flex-direction: column;
        align-items: stretch;
    }

    .validar_whats_code_input {
        max-width: 100%;
    }

    .validar_whats_submit_btn {
        width: 100%;
    }
}

.form-loading-overlay{
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: .5rem;
}

.form-loading-overlay.show{ display:flex; }

.form-loading-box{
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: .75rem;
  padding: .75rem 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  font-size: .95rem;
}
