/* Maurin — Module « popup formulaire » */

.maurin-fpopup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647 !important;
    padding: 10px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* La puce CookiesWork reste strictement derrière et masquée quand la popup formulaire est ouverte */
body.maurin-fpopup-open .cookieswork-trigger-btn,
.maurin-fpopup-overlay.open ~ .cookieswork-trigger-btn,
body:has(.maurin-fpopup-overlay.open) .cookieswork-trigger-btn {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
    transform: scale(0.5) !important;
}

.maurin-fpopup-overlay::-webkit-scrollbar {
    display: none;
}

@keyframes fpopupOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fpopupOverlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes fpopupModalIn {
    0%   { opacity: 0; transform: scale(0.92) translateY(16px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fpopupModalOut {
    0%   { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0.92) translateY(14px); }
}

.maurin-fpopup-overlay.open {
    display: flex;
    animation: fpopupOverlayIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.maurin-fpopup-overlay.open .maurin-fpopup {
    animation: fpopupModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.maurin-fpopup-overlay.is-closing {
    display: flex;
    animation: fpopupOverlayOut 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

.maurin-fpopup-overlay.is-closing .maurin-fpopup {
    animation: fpopupModalOut 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.maurin-fpopup {
    position: relative;
    width: 92%;
    max-width: 760px;
    height: 94vh;
    max-height: 880px;
    min-height: 440px;
    margin: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.maurin-fpopup-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.maurin-fpopup-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.maurin-fpopup-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(42, 109, 71, 0.18);
    border-top-color: #2a6d47;
    border-radius: 50%;
    animation: fpopupSpin 0.75s linear infinite;
}

@keyframes fpopupSpin {
    to { transform: rotate(360deg); }
}

.maurin-fpopup-iframe {
    width: 100%;
    border: 0;
    display: block;
    height: 100% !important;
    min-height: 100% !important;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.maurin-fpopup-close {
    position: absolute;
    top: 4px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 0px !important;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px;
    transition: background 0.2s ease;
}

.maurin-fpopup-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 600px) {
    .maurin-fpopup {
        width: 96%;
        max-width: 100%;
        height: 92vh;
        max-height: 92vh;
        min-height: 0;
        border-radius: 14px;
    }

    .maurin-fpopup-iframe {
        height: 100% !important;
        max-height: 100% !important;
    }

    .maurin-fpopup-overlay {
        padding: 2vh 8px;
    }
}
