/* ============================================
   MODALES LÉGALES - Legal Notice, Privacy Policy, Terms & Conditions
   ============================================ */

/* Overlay commun */
.legal-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 9998 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    pointer-events: none;
}

.legal-modal-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: opacity 0.3s ease, visibility 0s 0s;
}

/* Desktop - Modale centrée */
@media (min-width: 769px) {
    .legal-modal {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0.95);
        width: 90%;
        max-width: 900px;
        max-height: 90vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-radius: 24px;
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
        z-index: 9999 !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.2s;
        overflow: hidden;
    }
    
    .legal-modal.active {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
        transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s;
    }
}

/* Mobile - Bottom Sheet */
@media (max-width: 768px) {
    .legal-modal {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
        z-index: 9999 !important;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-bottom: env(safe-area-inset-bottom, 20px);
        overflow: hidden;
    }
    
    .legal-modal.active {
        transform: translateY(0);
    }
}

/* Header - Style premium épuré */
.legal-modal__header {
    background: white;
    padding: 30px 40px 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
}

@media (max-width: 768px) {
    .legal-modal__header {
        padding: 30px 20px 20px;
    }
    
    /* Handle mobile */
    .legal-modal__header::before {
        content: '';
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
}

.legal-modal__header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.legal-modal__icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #B8461F 0%, #D85A2E 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(184, 70, 31, 0.25);
}

@media (max-width: 768px) {
    .legal-modal__icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

.legal-modal__title {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    color: #1a1a1a;
}

@media (max-width: 768px) {
    .legal-modal__title {
        font-size: 20px;
    }
}

.legal-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(184, 70, 31, 0.08);
    border: none;
    border-radius: 50%;
    color: #ef4444;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.legal-modal__close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .legal-modal__close {
        width: 36px;
        height: 36px;
        font-size: 18px;
        top: 16px;
        right: 16px;
    }
}

/* Body */
.legal-modal__body {
    padding: 40px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
    overflow-x: hidden;
    color: #333333;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .legal-modal__body {
        padding: 24px 20px;
        max-height: calc(90vh - 120px - env(safe-area-inset-bottom, 20px));
    }
}

/* Scrollbar personnalisée */
.legal-modal__body::-webkit-scrollbar {
    width: 6px;
}

.legal-modal__body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.legal-modal__body::-webkit-scrollbar-thumb {
    background: rgba(184, 70, 31, 0.3);
    border-radius: 3px;
}

.legal-modal__body::-webkit-scrollbar-thumb:hover {
    background: rgba(184, 70, 31, 0.5);
}

/* Sections */
.legal-section {
    margin-bottom: 32px;
}

.legal-section__title {
    font-size: 20px;
    font-weight: 700;
    color: #B8461F;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-section__title i {
    font-size: 18px;
}

@media (max-width: 768px) {
    .legal-section__title {
        font-size: 18px;
    }
    
    .legal-section__title i {
        font-size: 16px;
    }
}

.legal-section__content {
    font-size: 15px;
    color: #555555;
    margin-bottom: 12px;
}

.legal-section__content strong {
    color: #333333;
    font-weight: 600;
}

@media (max-width: 768px) {
    .legal-section__content {
        font-size: 14px;
    }
}

.legal-section__list {
    list-style: none;
    padding-left: 0;
    margin: 16px 0;
}

.legal-section__list li {
    padding-left: 28px;
    margin-bottom: 12px;
    position: relative;
}

.legal-section__list li:before {
    content: "•";
    color: #B8461F;
    font-weight: bold;
    font-size: 20px;
    position: absolute;
    left: 8px;
    top: -2px;
}

/* Highlight boxes */
.legal-highlight {
    background: rgba(184, 70, 31, 0.05);
    border-left: 4px solid #B8461F;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.legal-highlight__title {
    font-weight: 700;
    color: #B8461F;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-highlight__content {
    font-size: 14px;
    color: #666666;
}

@media (max-width: 768px) {
    .legal-highlight {
        padding: 16px;
        margin: 16px 0;
    }
    
    .legal-highlight__content {
        font-size: 13px;
    }
}

/* Empêcher le scroll du body quand la modale est ouverte */
body.legal-modal-open {
    overflow: hidden;
}
