/* Popup Formulario ISTPN 1.2.0: compacto, centrado y adaptable a la pantalla. */
.istpn-popup-root[hidden] { display: none !important; }
.istpn-popup-root, .istpn-popup-root * { box-sizing: border-box; }
.istpn-popup-root {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    isolation: isolate;
    font-family: Arial, Helvetica, sans-serif;
}
.istpn-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--istpn-overlay-alpha, .55));
}
.istpn-popup-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--istpn-popup-max-width, 560px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: 0;
    overflow: visible;
    padding: 10px;
    background: #fff;
    color: #17212d;
    border-radius: 15px;
    border: 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: istpn-popup-in .32s ease both;
}
.istpn-popup-root .istpn-popup-image-frame {
    position: relative;
    width: 100%;
    flex: 0 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 10px;
    line-height: 0;
}
.istpn-popup-root .istpn-popup-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    object-fit: contain;
    transform: scale(1);
    transform-origin: var(--istpn-image-origin-x, 50%) var(--istpn-image-origin-y, 50%);
    transition: transform .3s cubic-bezier(.2, .75, .25, 1), transform-origin .12s ease-out;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .istpn-popup-root .istpn-popup-zoom-enabled { cursor: zoom-in; }
    .istpn-popup-root .istpn-popup-zoom-enabled:hover .istpn-popup-image {
        transform: scale(var(--istpn-popup-zoom-scale, 1.7));
    }
}
.istpn-popup-root .istpn-popup-action {
    display: block;
    width: 100%;
    flex: 0 0 auto;
    margin: 0;
    padding: 11px 14px;
    text-align: center;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
    border-radius: 9px;
    background: var(--istpn-popup-button-color, #0073aa);
    color: #fff !important;
    text-decoration: none !important;
    border: 0;
    transition: filter .15s ease;
}
.istpn-popup-root .istpn-popup-action:hover,
.istpn-popup-root .istpn-popup-action:focus-visible {
    filter: brightness(.85);
    color: #fff !important;
}
/* Cierre circular flotante: no reserva altura encima del cartel. */
.istpn-popup-root .istpn-popup-close {
    position: absolute;
    z-index: 4;
    top: -8px;
    right: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--istpn-popup-button-color, #0073aa);
    color: #fff;
    font: 400 26px/1 Arial, Helvetica, sans-serif;
    text-transform: none;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
    transition: filter .15s ease, transform .15s ease;
}
.istpn-popup-root .istpn-popup-close:hover,
.istpn-popup-root .istpn-popup-close:focus-visible {
    background: var(--istpn-popup-button-color, #0073aa);
    color: #fff;
    filter: brightness(.85);
    transform: scale(1.04);
}
.istpn-popup-root .istpn-popup-close span { font-size: inherit; line-height: 1; margin-top: -2px; }
.istpn-popup-root :is(.istpn-popup-close, .istpn-popup-action):focus-visible {
    outline: 3px solid #003c88;
    outline-offset: 3px;
}
.istpn-popup-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
body.istpn-popup-body-open { overflow: hidden !important; }
@keyframes istpn-popup-in {
    from { opacity: 0; transform: translateY(-10px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 480px) {
    .istpn-popup-root { padding: 10px; }
    .istpn-popup-dialog {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        padding: 8px;
        gap: 7px;
        border-radius: 12px;
    }
    .istpn-popup-root .istpn-popup-close { width: 36px; height: 36px; min-width: 36px; min-height: 36px; top: -6px; right: -6px; }
}
@media (prefers-reduced-motion: reduce) {
    .istpn-popup-dialog { animation: none; }
    .istpn-popup-root .istpn-popup-action,
    .istpn-popup-root .istpn-popup-close,
    .istpn-popup-root .istpn-popup-image { transition: none; }
}
