/* ============================================================
   RECURSOS — estilos compartidos entre page-recursos.php y
   single-recurso.php (fondo de página + modal de descarga)
   Prefijo: .pr-
   ============================================================ */

.pr-page {
    background: var(--wp--preset--color--white-04);
}

/* ── Modal de descarga (placeholder de diseño) ───────────────
   Sin lógica de envío todavía: se conectará con Brevo en la siguiente
   fase. Por ahora solo abre/cierra visualmente. Se abre tanto desde las
   tarjetas del listado como desde el CTA de la página de cada guía. */
.pr-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pr-modal.is-open {
    visibility: visible;
    opacity: 1;
}

.pr-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(29, 29, 30, 0.55);
    backdrop-filter: blur(2px);
}

.pr-modal-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--wp--preset--color--white);
    border-radius: var(--wp--custom--radius--lg);
    padding: 44px;
    box-shadow: var(--shadow-xl);
    transform: translateY(12px);
    transition: transform 0.25s ease;
}

.pr-modal.is-open .pr-modal-panel {
    transform: translateY(0);
}

.pr-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--wp--preset--color--white-02);
    color: var(--wp--preset--color--black);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pr-modal-close .material-symbols-outlined {
    font-size: 20px;
}

/* ── Vista de agradecimiento tras enviar el formulario ───────
   Sustituye al formulario dentro del mismo modal (no es un modal aparte):
   fondo azul de marca, texto blanco. Se cierra sola a los 3 segundos (ver
   el JS en template-parts/pr-download-modal.php), o antes si se cierra a
   mano con el botón de la esquina. */
.pr-modal-panel.is-success {
    background: var(--wp--preset--color--main-blue);
    transition: background-color 0.2s ease, transform 0.25s ease;
}

.pr-modal-panel.is-success .pr-modal-close {
    background: rgba(255, 255, 255, 0.16);
    color: var(--wp--preset--color--white);
}

.pr-modal-success {
    text-align: center;
    padding: 12px 0 4px;
    cursor: pointer;
}

.pr-modal-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 24px;
}

/* .pr-modal-panel h2 (más abajo) pinta cualquier h2 en azul — como este
   título también es un h2, hace falta más especificidad aquí para que
   gane y no se quede en azul sobre azul (invisible). */
.pr-modal-success .pr-modal-success-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: var(--wp--custom--weight-700);
    font-size: var(--wp--preset--font-size-h4);
    color: var(--wp--preset--color--white);
    padding-right: 0;
    margin: 0 0 14px;
}

.pr-modal-success-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--wp--preset--font-size--small);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 14px;
}

.pr-modal-panel h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: var(--wp--custom--weight-700);
    font-size: var(--wp--preset--font-size-h5);
    color: var(--wp--preset--color--main-blue);
    margin: 0 0 10px;
    padding-right: 24px;
}

.pr-modal-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--wp--preset--font-size--small);
    line-height: 1.5;
    color: var(--wp--preset--color--black);
    margin: 0 0 24px;
}

.pr-modal-form-placeholder {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px dashed var(--wp--preset--color--grey-05);
    border-radius: var(--wp--custom--radius--md);
    padding: 20px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--wp--preset--font-size--extra--small);
    color: var(--wp--preset--color--text-secondary);
}

body.pr-modal-locked {
    overflow: hidden;
}

/* ── Formulario dentro del modal ─────────────────────────────
   Mismo estilo que .si-form-card en page-solicitar-info.css, pero
   escalado al ancho del modal (más estrecho que la columna completa de
   esa página): menos padding, tipografía algo más pequeña. El formulario
   en sí se inserta aquí en tiempo de ejecución (ver el JS del modal). */
/* Un único campo (email) desde que se simplificó el formulario — ya no
   hace falta rejilla de 2 columnas, solo se apila. */
.pr-modal-form .wpcf7-form .form-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pr-modal-form .form-grid .field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pr-modal-form .form-label,
.pr-modal-form .overlap {
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--wp--preset--font-size--form-tag);
    font-weight: 400;
    letter-spacing: 0.04em;
    /* Mismo fix que page-solicitar-info.css: grey-06 (#8A8A8A) da 3.34:1
       sobre el fondo del input (white-04, #FBFBFB), por debajo del 4.5:1 de
       WCAG AA. #5B5B63 da 6.50:1 sobre white-04 y 6.73:1 sobre blanco. */
    color: #5B5B63;
}

.pr-modal-form input[type="text"],
.pr-modal-form input[type="email"],
.pr-modal-form input[type="tel"],
.pr-modal-form select,
.pr-modal-form textarea {
    width: 100%;
    border: 1px solid var(--wp--preset--color--grey-05);
    border-radius: var(--wp--custom--radius--xs);
    padding: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--wp--preset--font-size--extra--small);
    color: var(--wp--preset--color--black);
    background: var(--wp--preset--color--white);
}

.pr-modal-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 38px;
}

.pr-modal-form input::placeholder,
.pr-modal-form textarea::placeholder {
    color: var(--wp--preset--color--grey-05);
}

.pr-modal-form input:focus,
.pr-modal-form select:focus,
.pr-modal-form textarea:focus {
    outline: none;
    border-color: var(--wp--preset--color--main-blue);
}

.pr-modal-form .privacy-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--wp--preset--font-size--extra--small);
    line-height: 1.5;
    color: var(--wp--preset--color--black);
    margin: 14px 0;
}

.pr-modal-form .privacy-accept {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--wp--preset--font-size--extra--small);
    color: var(--wp--preset--color--black);
    margin-bottom: 20px;
    cursor: pointer;
}

.pr-modal-form .privacy-accept input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--wp--preset--color--main-blue);
}

.pr-modal-form .privacy-accept a {
    color: var(--wp--preset--color--black);
}

.pr-modal-form .form-submit {
    margin: 0;
}

/* Relleno azul, píldora, MAYÚSCULAS, hover y foco: "Botón unificado"
   (assets/css/base.css). Aquí solo el ancho completo dentro del modal. */
.pr-modal-form input[type="submit"],
.pr-modal-form .wpcf7-submit {
    width: 100%;
}

.pr-modal-form .wpcf7-not-valid-tip {
    font-size: var(--wp--preset--font-size--extra--small);
    color: var(--wp--preset--color--error);
    margin-top: 4px;
}

.pr-modal-form .wpcf7-response-output {
    margin: 14px 0 0;
    border-radius: var(--wp--custom--radius--xs);
    font-size: var(--wp--preset--font-size--extra--small);
}

/* ── Popup lista de espera openhealth one ────────────────────
   Reutiliza todo lo anterior (template-parts/lista-espera-vital365-modal.php);
   solo necesita lo que en recursos resuelve Contact Form 7: el apilado del
   campo, el campo trampa oculto y el mensaje de error. */
.pr-modal-form .lev-form .form-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pr-modal-form .lev-hp {
    display: none;
}

/* Sin .wpcf7 el checkbox no recibe el estilo de base.css y hereda el de
   los campos de texto (radio 15px + padding): quedaba redondo. Se replica
   aquí el cuadrado de los formularios CF7. */
.pr-modal-form .lev-form .privacy-accept input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin-top: 0;
    padding: 0;
    background-color: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--grey-06);
    border-radius: 2.5px;
    cursor: pointer;
}

.pr-modal-form .lev-form .privacy-accept input[type="checkbox"]:checked {
    background: url("../img/checked.svg") no-repeat;
    background-size: cover;
    border: none;
}

.pr-modal-form .lev-form .privacy-accept input[type="checkbox"]:checked::after {
    display: none;
}

.pr-modal-form .lev-form .privacy-accept input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--wp--preset--color--main-blue);
    outline-offset: 2px;
}

.pr-modal-form .lev-form-error {
    margin: 0 0 14px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--wp--preset--font-size--extra--small);
    color: var(--wp--preset--color--error);
}

.pr-modal-form .lev-form input[type="submit"]:disabled {
    opacity: 0.6;
    cursor: progress;
}

@media (max-width: 768px) {
    .pr-modal-panel {
        padding: 32px 24px;
    }
}