/*
 * CRRE: one frame for the "Send Me A Message" popup on agent singles. Enqueued only there by
 * inc/agents/agent-popup.php (see its header). AIOS's aiosPopup owns the popup. The aios-agents
 * template card (#agents-popup-form) is the single visible frame, and AIOS's × is the only ×.
 *
 * !important is needed against the template's runtime-injected rule
 * .agents-popup-form:not(.aiosp-hide) { position:fixed; top:50%; left:50%; transform:…; z-index:9999 }
 * (template-ap-1-agents-single.js:353-362).
 */

/* AIOS's content box: no frame of its own, sized to the card. It must outrank AIOS's
 * .aiosp-wrap .aiosp-container .aios-popup-body { background:#fff; width:80%; padding:1%; min-height:500px }
 * (resources.agentimage.com/libraries/css/aios-popup.min.css). The class is aiosp-ref-#agents-popup-form. */
.aiosp-wrap .aiosp-container.aiosp-ref-\#agents-popup-form .aiosp-content.aios-popup-body {
    background: transparent;
    padding: 0;
    min-height: 0;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* The card, back in normal flow inside AIOS's container. */
.aiosp-content #agents-popup-form.agents-popup-form {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 auto;
}

/* Fields stay inside the card. The template gives them no width, so the CF7 default size="40"
 * made Last Name / Phone overflow the card's right edge (pre-existing; also in the template popup). */
.aiosp-content #agents-popup-form .wpcf7-form-control:not(.wpcf7-submit) {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* One ×: AIOS's (.aiosp-close). The template's own button is hidden. */
.aiosp-content #agents-popup-form .popup-close {
    display: none !important;
}

/* AIOS's ×, placed inside the card's top-right corner. */
.aiosp-ref-\#agents-popup-form .aiosp-close {
    top: 12px;
    right: 12px;
    color: #1d2b2b;
    opacity: 0.8;
}

/* Belt and braces: the template's overlay never shows on these pages. */
.popup-overlay {
    display: none !important;
}
