/**
 * Popup del formulario de HubSpot: se abre desde los botones "Solicitar
 * propuesta"/"Solicitar formación" de varias páginas, en vez de llevar a
 * /contacto. Un único popup por página, compartido por todos los botones
 * que lo abren (ver assets/popup-hubspot.js).
 */

.hds-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.hds-popup.is-abierto {
    /* Centrado vertical y horizontal en la pantalla (pedido del cliente). */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Velo gris neutro y algo de desenfoque, en vez del navy translúcido de
   antes: con el panel navy encima, un velo azulado se confundía con él y
   apenas había contraste (pedido del cliente). */
.hds-popup__fondo {
    position: absolute;
    inset: 0;
    background: rgba(28, 30, 36, 0.72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.hds-popup__panel {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    margin: 0;
    /* Navy, como el bloque del formulario en Contacto: el formulario de
       HubSpot trae letras y botón en blanco (se configura en HubSpot). */
    background: var(--hds-navy);
    border-radius: var(--hds-radio-tarjeta);
    padding: 32px 32px 30px;
    box-shadow: 0 30px 60px rgba(29, 40, 84, 0.35);
}

/* Con la clase del popup delante: los estilos de <button> del tema y de
   Elementor tienen el mismo peso que una clase sola y lo pintaban como un
   cuadrado navy, invisible sobre el panel. */
.hds-popup .hds-popup__cerrar {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--hds-white);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.hds-popup .hds-popup__cerrar:hover,
.hds-popup .hds-popup__cerrar:focus-visible {
    background: var(--hds-green); /* el claro: el panel es navy (paginas.css) */
    color: var(--hds-navy);
}

.hds-popup .hds-popup__cerrar:focus-visible {
    outline: 3px solid var(--hds-white);
    outline-offset: 2px;
}

/* También con la clase del popup delante: el color de los <h2> del kit de
   Elementor ganaba a una clase sola y el título salía navy sobre navy. */
.hds-popup .hds-popup__titulo {
    margin: 0 40px 4px 0;
    font-size: var(--hds-fs-h4);
    font-weight: 700;
    line-height: 1.25;
    color: var(--hds-white);
}

.hds-popup .hds-popup__subtitulo {
    margin: 0 0 18px;
    font-size: var(--hds-fs-caption);
    line-height: 1.5;
    color: var(--hds-texto-sobre-oscuro);
}

/* --- Formulario de HubSpot (propuesta v3), para fondo navy -------------
   Con la opción `css` del embed (shortcodes.php) HubSpot no usa iframe y el
   formulario se pinta en la página. Los !important ganan a las reglas que
   inyecta HubSpot y al kit de Elementor. */
.hds-formulario-hubspot .hs-form { font-family: var(--hds-fuente); font-size: 14px; color: var(--hds-white); }
.hds-formulario-hubspot .hs-form fieldset { max-width: none !important; margin: 0; padding: 0; border: 0; }
.hds-formulario-hubspot .hs-form fieldset.form-columns-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hds-formulario-hubspot .hs-form fieldset .hs-form-field { float: none !important; width: auto !important; margin: 0 0 12px; }
.hds-formulario-hubspot .hs-form fieldset .input { margin: 0 !important; }
.hds-formulario-hubspot .hs-form .hs-form-field > label:not(.hs-form-booleancheckbox-display) { display: none; }

.hds-formulario-hubspot .hs-form .hs-input:not([type=checkbox]) {
    box-sizing: border-box;
    width: 100% !important;
    min-height: 44px !important;
    padding: 11px 14px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--hds-campo-hero) !important;
    color: var(--hds-navy-hero) !important;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: none;
}
.hds-formulario-hubspot .hs-form .hs-input::placeholder { color: var(--hds-gray-hero); opacity: 1; }
.hds-formulario-hubspot .hs-form .hs-input:not([type=checkbox]):focus { background: var(--hds-white) !important; outline: 2px solid var(--hds-green-boton); outline-offset: 0; }
.hds-formulario-hubspot .hs-form textarea.hs-input { min-height: 96px !important; resize: vertical; }

.hds-formulario-hubspot .hs-form .inputs-list { margin: 0; padding: 0; list-style: none; }
.hds-formulario-hubspot .hs-form .legal-consent-container .hs-form-field { margin-bottom: 6px; }
.hds-formulario-hubspot .hs-form .hs-form-booleancheckbox-display { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.5; color: var(--hds-texto-sobre-oscuro); }
.hds-formulario-hubspot .hs-form .hs-form-booleancheckbox-display > span { margin-left: 0 !important; }
.hds-formulario-hubspot .hs-form .hs-form-booleancheckbox-display input { float: none; flex: none; width: auto; margin: 3px 0 0; }
.hds-formulario-hubspot .hs-form .hs-form-booleancheckbox-display input:focus-visible { outline: 2px solid var(--hds-green-boton); outline-offset: 2px; }
.hds-formulario-hubspot .hs-form a { color: var(--hds-white); text-decoration: underline; }
.hds-formulario-hubspot .hs-form .hs-form-required { color: var(--hds-texto-sobre-oscuro); }
.hds-formulario-hubspot .hs-form .hs-field-desc:empty { display: none; }

.hds-formulario-hubspot .hs-form .hs-error-msgs { margin: 6px 0 0; padding: 0; list-style: none; }
.hds-formulario-hubspot .hs-form .hs-error-msgs label,
.hds-formulario-hubspot .hs-form .hs-error-msg { font-size: 12px; color: #FFB4A8; }
.hds-formulario-hubspot .hs-form .hs-input.invalid.error { outline: 2px solid #FFB4A8; }
.hds-formulario-hubspot .hs-form .hs_error_rollup { display: none; }

.hds-formulario-hubspot .hs-form .actions { margin-top: 14px; }
.hds-formulario-hubspot .hs-form .hs-button {
    padding: 11px 26px;
    border: 0;
    border-radius: 10px;
    background: var(--hds-white);
    color: var(--hds-navy-hero);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.hds-formulario-hubspot .hs-form .hs-button:hover { background: var(--hds-green-boton); color: var(--hds-green-boton-texto); }
.hds-formulario-hubspot .hs-form .hs-button:focus-visible { outline: 3px solid var(--hds-green-boton); outline-offset: 3px; }
.hds-formulario-hubspot .submitted-message { font-size: 15px; color: var(--hds-white); }

@media (max-width: 480px) {
    .hds-formulario-hubspot .hs-form fieldset.form-columns-2 { grid-template-columns: 1fr; gap: 0; }
}

body.hds-popup-bloqueo { overflow: hidden; }

@media (max-width: 600px) {
    .hds-popup.is-abierto { padding: 12px; }
    .hds-popup__panel { padding: 26px 20px; max-height: calc(100dvh - 24px); }
}
