/**
 * Fenêtre de formulaire (components/form-modal + assets/js/form-modal.js).
 * Reprend le rendu de la fenêtre « Votre domicile est éligible » de
 * l'éligibilité (celtiis-eligibility/assets/css/eligibility.css).
 */

.cw-form-modal-open {
    overflow: hidden;
}

.cw-form-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .25s ease;
}

.cw-form-modal[hidden] {
    display: none;
}

.cw-form-modal.is-open {
    opacity: 1;
}

.cw-form-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 52, .66);
    backdrop-filter: blur(3px);
}

.cw-form-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 32px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(10, 25, 52, .28);
    outline: none;
    transform: translateY(18px) scale(.96);
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
    overscroll-behavior: contain;
}

.cw-form-modal.is-open .cw-form-modal__dialog {
    transform: translateY(0) scale(1);
}

.cw-form-modal__close {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(29, 61, 112, .08);
    color: var(--bs-secondary, #1D3D70);
    font: 400 30px/1 Arial, sans-serif;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
}

.cw-form-modal__close:hover {
    background: rgba(29, 61, 112, .16);
    transform: rotate(5deg);
}

.cw-form-modal__close:focus-visible {
    outline: 2px solid var(--bs-secondary, #1D3D70);
    outline-offset: 3px;
}

.cw-form-modal__header {
    margin: 0 0 22px;
    padding-right: 48px; /* place du bouton × */
}

.cw-form-modal__title {
    margin: 0;
    color: var(--bs-secondary, #1D3D70);
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}

.cw-form-modal__lead {
    margin: 8px 0 0;
    color: #65758B;
    font-size: 15px;
    line-height: 1.55;
}

@media (max-width: 575.98px) {
    .cw-form-modal {
        padding: 12px;
    }

    .cw-form-modal__dialog {
        max-height: calc(100vh - 24px);
        padding: 24px 20px;
        border-radius: 20px;
    }

    .cw-form-modal__title {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cw-form-modal,
    .cw-form-modal__dialog {
        transition: none;
    }
}
