/* Maurin — Module « popup formulaire » (Dacia UAT) */

.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 !important;
    scrollbar-color: #646B52 rgba(0, 0, 0, 0.05) !important;
}

/* 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 {
    width: 6px;
    background: rgba(0, 0, 0, 0.05);
}
.maurin-fpopup-overlay::-webkit-scrollbar-thumb {
    background: #646B52;
    border-radius: 0px !important;
}

@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: 0px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin !important;
    scrollbar-color: #646B52 rgba(0, 0, 0, 0.05) !important;
}

.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(100, 107, 82, 0.2);
    border-top-color: #646B52;
    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 !important;
    overflow-x: hidden !important;
    scrollbar-width: thin !important;
    scrollbar-color: #646B52 rgba(0, 0, 0, 0.05) !important;
}

.maurin-fpopup-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 0px !important;
    background: #273A33;
    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, transform 0.15s ease;
}

.maurin-fpopup-close:hover {
    opacity: 1;
    background: #C35334;
    color: #fff;
}

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

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

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

/* === #financeModal Styles (cgi-legals-modal) === */
#financeModal .modal-content {
    border: none;
    border-radius: 0px !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    background: #ffffff;
}

#financeModal .modal-header {
    padding: 20px 24px 16px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

#financeModal .modal-body {
    padding: 24px;
    min-height: 240px;
    scrollbar-width: thin !important;
    scrollbar-color: #646B52 rgba(0, 0, 0, 0.05) !important;
}

/* Animations de chargement */
.finance-loader-container {
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.finance-loader-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(100, 107, 82, 0.15);
    border-top-color: #646B52;
    border-radius: 50%;
    animation: financeSpin 0.75s linear infinite;
    margin-bottom: 14px;
}

@keyframes financeSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.finance-loader-title {
    font-size: 15px;
    font-weight: 600;
    color: #212221;
    margin-bottom: 4px;
    animation: financePulse 1.6s ease-in-out infinite;
}

.finance-loader-subtitle {
    font-size: 12px;
    color: #868d89;
    margin-bottom: 22px;
}

@keyframes financePulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

.finance-skeleton-wrap {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.finance-skeleton-bar {
    height: 10px;
    border-radius: 0px !important;
    background: linear-gradient(90deg, #f2f4f3 25%, #e1e7e3 50%, #f2f4f3 75%);
    background-size: 200% 100%;
    animation: financeShimmer 1.4s ease-in-out infinite;
}

@keyframes financeShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Animation douce d'apparition du contenu */
.finance-modal-content-fade {
    opacity: 0;
    animation: financeSmoothReveal 0.65s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
    line-height: 1.7;
    font-size: 13.5px;
    color: #2b2b2b;
}

@keyframes financeSmoothReveal {
    0% {
        opacity: 0;
        transform: translateY(18px);
        filter: blur(5px);
    }
    50% {
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

#financeModal #produitfinancier {
    font-family: inherit;
}

#financeModal #mentionpedagoiqueremboursement h3 {
    font-size: 15px !important;
    line-height: 1.4 !important;
    color: #111;
    margin-bottom: 8px;
}

#financeModal #partie1,
#financeModal #partie2,
#financeModal #partie4,
#financeModal #informindicative,
#financeModal #partie5,
#financeModal #partie6,
#financeModal #partie7 {
    padding-bottom: 12px;
    margin-bottom: 12px !important;
    border-bottom: 1px solid #f0f0f0;
}

/* === Dacia Custom Internal Scrollbar Styling === */
.maurin-fpopup,
.maurin-fpopup-iframe,
.maurin-fpopup-overlay,
#financeModal .modal-body {
    scrollbar-width: thin !important;
    scrollbar-color: #646B52 rgba(0, 0, 0, 0.05) !important;
}

.maurin-fpopup::-webkit-scrollbar,
.maurin-fpopup-overlay::-webkit-scrollbar,
#financeModal .modal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.maurin-fpopup::-webkit-scrollbar-track,
.maurin-fpopup-overlay::-webkit-scrollbar-track,
#financeModal .modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.maurin-fpopup::-webkit-scrollbar-thumb,
.maurin-fpopup-overlay::-webkit-scrollbar-thumb,
#financeModal .modal-body::-webkit-scrollbar-thumb {
    background: #646B52;
    border-radius: 0px !important;
}

.maurin-fpopup::-webkit-scrollbar-thumb:hover,
.maurin-fpopup-overlay::-webkit-scrollbar-thumb:hover,
#financeModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #575E48;
}
