/* ===================================
   PAGES LÉGALES - STYLES RESPONSIVE
   Solution, Stratégie et Sens
   =================================== */

/* ===================================
   HERO DES PAGES LÉGALES
   =================================== */

.legal-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-sage-dark) 0%, var(--color-sage) 60%, var(--color-sage-light) 100%);
    color: var(--color-white);
    text-align: center;
    padding: 4rem 0;
    overflow: hidden;
}

.legal-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.legal-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.legal-hero .container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.legal-hero h1 {
    font-family: var(--font-primary);
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
}

.legal-hero .subtitle {
    font-size: 1.15rem;
    font-weight: 300;
    max-width: 700px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

@media (max-width: 768px) {
    .legal-hero {
        padding: 3rem 0;
    }

    .legal-hero h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .legal-hero .subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .legal-hero h1 {
        font-size: 1.6rem;
    }
}

/* ===================================
   STYLES DE BASE
   =================================== */

.legal-page {
    background: var(--color-white);
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

.legal-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Fil d'Ariane légal (optionnel) */
.legal-breadcrumb {
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    color: var(--color-gray-medium);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-gray-light);
}

.legal-breadcrumb a {
    color: var(--color-sage);
    text-decoration: none;
}

.legal-breadcrumb a:hover {
    color: var(--color-gold);
}

/* Sections */
.legal-section {
    background: var(--color-white);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--color-sage-light);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.legal-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-left-color: var(--color-sage);
}

.legal-section h2 {
    font-family: var(--font-primary);
    font-size: 1.75rem;
    color: var(--color-gray-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-gray-lighter);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.legal-section h2 i {
    color: var(--color-sage);
    flex-shrink: 0;
}

.legal-section h3 {
    font-family: var(--font-secondary);
    font-size: 1.3rem;
    color: var(--color-gray-dark);
    margin: 2rem 0 1rem 0;
    font-weight: 600;
}

.legal-section h4 {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    color: var(--color-sage-dark);
    margin: 1.5rem 0 0.75rem 0;
    font-weight: 600;
}

/* Contenu */
.legal-info p {
    font-family: var(--font-secondary);
    color: var(--color-gray-medium);
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.legal-info p:last-child {
    margin-bottom: 0;
}

.legal-info strong {
    color: var(--color-gray-dark);
    font-weight: 600;
}

.legal-info a {
    color: var(--color-sage);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    word-wrap: break-word;
}

.legal-info a:hover {
    color: var(--color-gold);
    text-decoration: underline;
}

.legal-info ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.legal-info li {
    font-family: var(--font-secondary);
    color: var(--color-gray-medium);
    line-height: 1.8;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Boxes spéciales */
.privacy-intro-box {
    background: linear-gradient(135deg, var(--color-sage-light), var(--color-sage));
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(156, 175, 136, 0.3);
}

.privacy-intro-box p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0;
    color: white;
}

.privacy-intro-box i {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.purpose-box, 
.cookie-type-box {
    background: var(--color-gray-lighter);
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    border-left: 4px solid var(--color-sage);
}

.purpose-box h4, 
.cookie-type-box h4 {
    color: var(--color-gray-dark);
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
}

/* Tables */
.retention-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    overflow-x: auto;
    display: block;
}

.retention-table thead {
    background: var(--color-sage);
    color: white;
}

.retention-table th,
.retention-table td {
    padding: 1rem;
    text-align: left;
    border: 1px solid var(--color-gray-light);
}

.retention-table tbody tr:nth-child(even) {
    background: var(--color-gray-lighter);
}

/* Highlight sections */
.highlight-section {
    border: 3px solid var(--color-gold);
    position: relative;
}

.highlight-section::before {
    content: "IMPORTANT";
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--color-gold);
    color: white;
    padding: 0.25rem 1rem;
    font-weight: bold;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Grilles de droits */
.rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.right-card {
    background: white;
    border: 2px solid var(--color-sage-light);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.right-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(156, 175, 136, 0.2);
    border-color: var(--color-sage);
}

.right-card h4 {
    color: var(--color-sage-dark);
    font-size: 1.1rem;
    margin: 0 0 0.75rem 0;
}

.right-card h4 i {
    color: var(--color-gold);
    margin-right: 0.5rem;
}

.right-card p {
    color: var(--color-gray-medium);
    font-size: 0.95rem;
    margin: 0;
}

/* Boutons */
.btn-manage-cookies {
    display: inline-block;
    /* background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark)); */
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 1.5rem 0;
}

.btn-manage-cookies:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    color: white;
}

/* Boxes info */
.exercise-rights {
    background: var(--service-blue-light);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.cnil-info {
    background: var(--service-green-light);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--service-green);
    margin-top: 2rem;
}

.contact-box {
    background: var(--color-gold-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* Date de mise à jour */
.legal-update {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    border-top: 2px solid var(--color-gray-light);
    background: var(--color-gray-lighter);
    border-radius: 8px;
}

.legal-update p {
    font-family: var(--font-secondary);
    color: var(--color-gray-medium);
    font-size: 0.95rem;
    margin: 0;
}

/* ===================================
   RESPONSIVE - TABLETTES (< 1024px)
   =================================== */

@media (max-width: 1024px) {
    .legal-page .container {
        padding: 0 1.5rem;
    }

    .legal-section {
        padding: 1.75rem;
    }

    .legal-section h2 {
        font-size: 1.6rem;
    }

    .rights-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.25rem;
    }
}

/* ===================================
   RESPONSIVE - MOBILE (< 768px)
   =================================== */

@media (max-width: 768px) {
    .legal-page {
        padding: 2rem 0;
    }

    .legal-page .container {
        padding: 0 1rem;
    }

    .legal-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        border-radius: 8px;
    }

    .legal-section h2 {
        font-size: 1.4rem;
        gap: 0.5rem;
    }

    .legal-section h2 i {
        font-size: 1.2rem;
    }

    .legal-section h3 {
        font-size: 1.15rem;
        margin: 1.5rem 0 0.75rem 0;
    }

    .legal-section h4 {
        font-size: 1rem;
    }

    .legal-info p,
    .legal-info li {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .legal-info ul {
        padding-left: 1.5rem;
    }

    /* Boxes */
    .privacy-intro-box {
        padding: 1.5rem;
    }

    .privacy-intro-box p {
        font-size: 1rem;
    }

    .privacy-intro-box i {
        font-size: 1.25rem;
        margin-right: 0.75rem;
    }

    .purpose-box,
    .cookie-type-box {
        padding: 1.25rem;
    }

    /* Tables responsive */
    .retention-table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .retention-table th,
    .retention-table td {
        padding: 0.75rem 0.5rem;
        min-width: 120px;
    }

    /* Grille de droits en une colonne */
    .rights-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .right-card {
        padding: 1.25rem;
    }

    /* Sections highlight */
    .highlight-section::before {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
        left: 10px;
        top: -12px;
    }

    /* Boutons */
    .btn-manage-cookies {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        text-align: center;
    }

    /* Boxes info */
    .exercise-rights,
    .cnil-info,
    .contact-box {
        padding: 1.25rem;
    }

    .legal-update {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
}

/* ===================================
   RESPONSIVE - PETIT MOBILE (< 480px)
   =================================== */

@media (max-width: 480px) {
    .legal-page {
        padding: 1.5rem 0;
    }

    .legal-page .container {
        padding: 0 0.75rem;
    }

    .legal-section {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .legal-section h2 {
        font-size: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .legal-section h3 {
        font-size: 1.1rem;
    }

    .legal-section h4 {
        font-size: 0.95rem;
    }

    .legal-info p,
    .legal-info li {
        font-size: 0.9rem;
    }

    .privacy-intro-box {
        padding: 1.25rem;
    }

    .privacy-intro-box p {
        font-size: 0.95rem;
    }

    .purpose-box,
    .cookie-type-box {
        padding: 1rem;
    }

    .retention-table {
        font-size: 0.8rem;
    }

    .retention-table th,
    .retention-table td {
        padding: 0.5rem 0.35rem;
        min-width: 100px;
    }

    .right-card {
        padding: 1rem;
    }

    .btn-manage-cookies {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .exercise-rights,
    .cnil-info,
    .contact-box {
        padding: 1rem;
    }

    .highlight-section::before {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

/* ===================================
   AMÉLIORATIONS D'ACCESSIBILITÉ
   =================================== */

/* Focus visible pour navigation au clavier */
.legal-info a:focus,
.btn-manage-cookies:focus {
    outline: 3px solid var(--color-sage);
    outline-offset: 2px;
}

/* Amélioration du contraste pour certains éléments */
@media (prefers-contrast: high) {
    .legal-info p,
    .legal-info li {
        color: var(--color-gray-dark);
    }
}



/* ===================================
   IMPRESSION
   =================================== */

@media print {
    .legal-page {
        background: white;
        padding: 0;
    }

    .legal-section {
        box-shadow: none;
        page-break-inside: avoid;
        border: 1px solid #ccc;
        border-left: 4px solid #9caf88;
        margin-bottom: 1rem;
    }

    .btn-manage-cookies,
    .cookie-banner-link {
        display: none;
    }

    .legal-info a {
        text-decoration: underline;
        color: #000;
    }

    .legal-info a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legal-section {
    animation: fadeIn 0.5s ease-out;
}

.legal-section:nth-child(1) { animation-delay: 0.1s; }
.legal-section:nth-child(2) { animation-delay: 0.15s; }
.legal-section:nth-child(3) { animation-delay: 0.2s; }
.legal-section:nth-child(4) { animation-delay: 0.25s; }
.legal-section:nth-child(5) { animation-delay: 0.3s; }

/* Désactiver les animations si l'utilisateur préfère */
@media (prefers-reduced-motion: reduce) {
    .legal-section {
        animation: none;
    }

    .legal-section:hover,
    .right-card:hover,
    .btn-manage-cookies:hover {
        transform: none;
    }
}
