/* ================================================================
   modal.css — Modal RDV Ovision
   ================================================================ */

:root {
    --modal-transition: .25s cubic-bezier(.4,0,.2,1);
    --modal-radius:     8px;
    --modal-max-width:  600px;
    --modal-max-width-rdv: 900px;
}

/* ----------------------------------------------------------------
   Overlay
   ---------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,57,99,.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--modal-transition);
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* ----------------------------------------------------------------
   Box
   ---------------------------------------------------------------- */
.modal-box {
    position: relative;
    background: #fff;
    border-radius: var(--modal-radius);
    width: 100%;
    max-width: var(--modal-max-width);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(26,57,99,.25);
    transform: translateY(16px) scale(.98);
    transition: transform var(--modal-transition);
}
.modal-overlay.open .modal-box {
    transform: translateY(0) scale(1);
}

/* ----------------------------------------------------------------
   Bouton fermer
   ---------------------------------------------------------------- */
.modal-close {
    position: sticky;
    top: 0;
    float: right;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 12px 12px 0 0;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
    transition: background .18s;
    -webkit-tap-highlight-color: transparent;
}
.modal-close:hover { background: #e5e7eb; }
.modal-close svg {
    width: 18px; height: 18px;
    fill: #374151;
}

/* ----------------------------------------------------------------
   Contenu injecté
   ---------------------------------------------------------------- */
.modal-content {
    padding: 16px 32px 32px;
    clear: both;
}

/* Loader */
.modal-loader {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: .9rem;
}

/* Erreur */
.modal-error {
    text-align: center;
    padding: 32px;
    color: #c42020;
    font-size: .9rem;
}

/* ----------------------------------------------------------------
   Modal plein écran — RDV iframe
   ---------------------------------------------------------------- */
.modal-fs {
    position: fixed;
    inset: 0;
    z-index: 9100;
    background: rgba(10,20,40,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--modal-transition);
}
.modal-fs.open {
    opacity: 1;
    pointer-events: auto;
}

/* Conteneur qui regroupe bouton + iframe */
.modal-fs-inner {
    position: relative;
    width: 80%;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-fs-inner iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0,0,0,.4);
}

.modal-fs-close {
    position: absolute;
    top: -16px;
    right: -16px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
    transition: background .18s, transform .18s;
}
.modal-fs-close:hover { background: #f3f4f6; transform: scale(1.08); }
.modal-fs-close svg { width: 18px; height: 18px; fill: #1a3963; }

@media (max-width: 767px) {
    .modal-fs {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding-top: var(--nav-height-mob);
        background: rgba(10,20,40,.55);
    }
    .modal-fs-inner {
        position: relative;
        flex: 1;
        width: 100%;
        height: auto;
        border-radius: 14px 14px 0 0;
        overflow: hidden;
        box-shadow: 0 -8px 32px rgba(0,0,0,.3);
    }
    .modal-fs-inner iframe {
        border-radius: 0;
        box-shadow: none;
    }
    .modal-fs-close {
        position: absolute;
        top: 8px;
        right: 8px;
    }
}

/* ----------------------------------------------------------------
   RDV — anciens styles (conservés pour fallback)
   ---------------------------------------------------------------- */
.modal-box--wide {
    max-width: var(--modal-max-width-rdv);
}

.modal-rdv-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1a3963;
    margin: 0 0 12px;
}

.modal-rdv-iframe-wrap {
    position: relative;
    width: 100%;
    height: 560px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eef0f3;
}

.modal-rdv-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.modal-rdv-fallback {
    text-align: center;
    margin-top: 12px;
    font-size: .85rem;
}

.modal-rdv-fallback a {
    color: #1a3963;
    font-weight: 700;
    text-decoration: underline;
}

/* ----------------------------------------------------------------
   Mentions légales / Politique de confidentialité
   ---------------------------------------------------------------- */
.modal-legal-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1a3963;
    margin: 0 0 20px;
}

.modal-legal h3 {
    font-size: .88rem;
    font-weight: 700;
    color: #1a3963;
    margin: 20px 0 6px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.modal-legal p {
    font-size: .83rem;
    color: #4b5563;
    line-height: 1.65;
    margin: 0 0 8px;
}

.modal-legal a { color: #1a3963; font-weight: 700; }

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media (max-width: 767px) {
    .modal-overlay {
        padding-top: calc(var(--nav-height-mob) + 12px);
    }
    .modal-box {
        max-height: calc(100vh - var(--nav-height-mob) - 12px);
    }
}

@media (max-width: 640px) {
    .modal-overlay {
        padding: 0;
        padding-top: var(--nav-height-mob);
        align-items: flex-end;
    }
    .modal-box {
        max-height: calc(100vh - var(--nav-height-mob));
        border-radius: var(--modal-radius) var(--modal-radius) 0 0;
    }
}
