/* ==================================================================
   legal-modal.css — Modal documents légaux (25/08/2026)
   Conteneur unique, contenu injecté depuis la base (innerHTML).
   Style aligné sur cookie-consent.css / modal cookies.
   ================================================================== */

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 2002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.legal-modal.open {
    display: flex;
}

.legal-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.legal-modal-dialog {
    position: relative;
    background: #ffffff;
    color: #1a1a1a;
    border-radius: 12px;
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.legal-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #003D99;
    margin: 0;
}

.legal-modal-close {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0 6px;
    transition: color 0.2s ease;
}

.legal-modal-close:hover {
    color: #003D99;
}

.legal-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.legal-modal-body h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #003D99;
    margin: 1.25rem 0 0.5rem;
}

.legal-modal-body h4:first-child {
    margin-top: 0;
}

.legal-modal-body p {
    margin: 0 0 0.85rem;
}

.legal-modal-body ul {
    margin: 0 0 0.85rem;
    padding-left: 1.25rem;
}

.legal-modal-body li {
    margin-bottom: 0.45rem;
}

.legal-modal-body strong {
    color: #1a1a1a;
}

.legal-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.legal-btn-print,
.legal-btn-close {
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.legal-btn-print {
    background: transparent;
    color: #003D99;
    border: 2px solid #003D99;
}

.legal-btn-close {
    background: #0052CC;
    color: #ffffff;
    border: none;
}

.legal-btn-print:hover,
.legal-btn-close:hover {
    transform: translateY(-2px);
}

/* --- Impression : n'imprimer que le document légal (25/08/2026) ---
   display:none sur le contenu de fond (visibility:hidden garderait la
   hauteur totale de la page -> pages blanches multiples).
   Le modal est repassé en flux normal (position: static) pour que le
   document s'imprime sur le nombre de pages réellement nécessaire. */
@media print {
    body.printing-legal > *:not(.legal-modal) {
        display: none !important;
    }
    .legal-modal,
    .legal-modal.open {
        position: static !important;
        display: block !important;
        padding: 0 !important;
        inset: auto;
    }
    .legal-modal-overlay,
    .legal-modal-close,
    .legal-modal-footer {
        display: none !important;
    }
    .legal-modal-dialog {
        position: static !important;
        max-width: 100% !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        display: block !important;
    }
    .legal-modal-body {
        overflow: visible !important;
        max-height: none !important;
    }
}

@media (max-width: 600px) {
    .legal-modal-dialog {
        max-height: 92vh;
    }
    .legal-modal-header,
    .legal-modal-footer {
        padding: 1rem;
    }
    .legal-modal-body {
        padding: 1.1rem;
    }
    .legal-btn-print,
    .legal-btn-close {
        flex: 1;
        text-align: center;
    }
}
