/**
 * Modal de captura previo a WhatsApp.
 * CSS plano a propósito: Tailwind se compila en un build aparte y este
 * marcado se imprime desde PHP, así que no pasaría por el escaneo de clases.
 */

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

.lavin-wa-modal {
    position: fixed;
    inset: 0;
    /* Por encima de la burbuja (9999) y del offcanvas del sitio. */
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lavin-wa-modal__fondo {
    position: absolute;
    inset: 0;
    background: rgba(27, 38, 50, 0.6);
    animation: lavin-wa-fade 0.2s ease-out;
}

.lavin-wa-modal__caja {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    padding: 32px 28px 26px;
    animation: lavin-wa-subir 0.25s ease-out;
}

.lavin-wa-modal__cerrar {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #8a8a8e;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.lavin-wa-modal__cerrar:hover {
    color: #1b2632;
    background: #f2f2f4;
}

.lavin-wa-modal__encabezado {
    text-align: center;
    margin-bottom: 22px;
}

.lavin-wa-modal__icono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    margin-bottom: 14px;
}

.lavin-wa-modal__icono svg {
    width: 28px;
    height: 28px;
}

.lavin-wa-modal__titulo {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    color: #1b2632;
}

.lavin-wa-modal__texto {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #6b6b70;
}

.lavin-wa-modal__campo {
    margin: 0 0 14px;
}

.lavin-wa-modal__campo label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #424245;
}

.lavin-wa-modal__campo input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 15px;
    color: #1b2632;
    background: #fff;
    border: 1px solid #d9d9de;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lavin-wa-modal__campo input:focus {
    outline: none;
    border-color: #497b9c;
    box-shadow: 0 0 0 3px rgba(73, 123, 156, 0.15);
}

.lavin-wa-modal__campo input[aria-invalid="true"] {
    border-color: #d63638;
}

/* Honeypot: fuera de la vista, pero no display:none (algunos bots lo detectan). */
.lavin-wa-modal__trampa {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.lavin-wa-modal__error {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
    color: #8a1f21;
    background: #fdeced;
    border-radius: 8px;
}

.lavin-wa-modal__error[hidden] {
    display: none;
}

.lavin-wa-modal__enviar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #25d366;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.lavin-wa-modal__enviar:hover {
    background: #1eb955;
}

.lavin-wa-modal__enviar[disabled] {
    opacity: 0.7;
    cursor: default;
}

.lavin-wa-modal__aviso {
    margin: 14px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: #8a8a8e;
}

.lavin-wa-modal__aviso a {
    color: #497b9c;
    text-decoration: underline;
}

@keyframes lavin-wa-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lavin-wa-subir {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .lavin-wa-modal__fondo,
    .lavin-wa-modal__caja {
        animation: none;
    }
}

@media (max-width: 480px) {
    .lavin-wa-modal__caja {
        padding: 28px 20px 22px;
    }
}
