/* ================= VARIABLES (mêmes que le site) ================= */
:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #06b6d4;
    --primary-hover: #0891b2;
    --secondary: #0ea5e9;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-glow: rgba(6, 182, 212, 0.3);
    --gradient: linear-gradient(135deg, #06b6d4, #0ea5e9);
    --danger: #ef4444;
    --success: #10b981;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.7;
}

/* Arrière-plan animé */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
    animation: pulse 10s infinite alternate;
}
.glow-1 { top: -100px; left: -100px; background: var(--primary); }
.glow-2 { bottom: -100px; right: -100px; background: var(--secondary); }
@keyframes pulse { 
    0% { transform: scale(1); opacity: 0.15; } 
    100% { transform: scale(1.2); opacity: 0.25; } 
}

/* ================= TOPBAR ================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo i { color: var(--primary); }

.btn-back {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--border-glow);
    transition: all 0.3s;
}
.btn-back:hover {
    background: rgba(6, 182, 212, 0.2);
    transform: translateX(-3px);
}

.hide-mobile { display: inline; }
@media (max-width: 500px) { .hide-mobile { display: none; } }

/* ================= CONTAINER ================= */
.legal-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.fade-in { animation: fadeIn 0.6s ease-out; }
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ================= HEADER ================= */
.legal-header {
    text-align: center;
    margin-bottom: 40px;
}

.legal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(14, 165, 233, 0.15));
    border: 2px solid var(--border-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--primary);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.2);
}

.legal-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

/* ================= LAYOUT 2 COLONNES ================= */
.legal-content-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

/* ================= TABLE DES MATIÈRES ================= */
.legal-toc {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 25px;
    position: sticky;
    top: 90px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
}

.legal-toc h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-toc ul {
    list-style: none;
}

.legal-toc li {
    margin-bottom: 6px;
}

.legal-toc a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: all 0.3s;
}

.legal-toc a:hover {
    color: var(--primary);
    background: rgba(6, 182, 212, 0.08);
    border-left-color: var(--primary);
    padding-left: 16px;
}

/* ================= CONTENU TEXTUEL ================= */
.legal-text {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
}

.intro-text {
    font-size: 16px;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
    background: rgba(6, 182, 212, 0.05);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    margin-bottom: 40px;
}

.legal-text section {
    margin-bottom: 40px;
    scroll-margin-top: 100px;
}

.legal-text h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

.article-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gradient);
    color: white;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.legal-text h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    margin: 20px 0 10px;
}

.legal-text p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 15px;
    line-height: 1.8;
}

.legal-text ul {
    list-style: none;
    margin: 15px 0;
    padding-left: 10px;
}

.legal-text ul li {
    color: var(--text-muted);
    font-size: 15px;
    padding: 8px 0 8px 30px;
    position: relative;
    line-height: 1.7;
}

.legal-text ul li::before {
    content: "\f058";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 8px;
    color: var(--primary);
    font-size: 14px;
}

.legal-text strong {
    color: var(--text-main);
    font-weight: 600;
}

/* ================= LIENS LÉGAUX EN BAS ================= */
.legal-footer-links {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-footer-links h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
}

.legal-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.legal-link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.legal-link-card i {
    font-size: 20px;
    color: var(--primary);
}

.legal-link-card:hover {
    background: rgba(6, 182, 212, 0.08);
    border-color: var(--border-glow);
    color: var(--text-main);
    transform: translateY(-2px);
}

.legal-link-card.active {
    background: rgba(6, 182, 212, 0.12);
    border-color: var(--primary);
    color: var(--primary);
    cursor: default;
}

.legal-link-card.active:hover {
    transform: none;
}

/* ================= TOAST ================= */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 14px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid var(--border-glow);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 90%;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: rgba(16, 185, 129, 0.5); }
.toast.success .toast-icon { color: #10b981; }
.toast.error { border-color: rgba(239, 68, 68, 0.5); }
.toast.error .toast-icon { color: #ef4444; }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
    .legal-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .legal-toc {
        position: static;
        order: -1;
    }
    
    .legal-text {
        padding: 25px;
    }
    
    .legal-header h1 {
        font-size: 28px;
    }
}

@media (max-width: 500px) {
    .legal-container {
        margin: 20px auto;
    }
    
    .legal-header h1 {
        font-size: 24px;
    }
    
    .article-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .legal-text h2 {
        font-size: 18px;
        gap: 10px;
    }
    
    .legal-links-grid {
        grid-template-columns: 1fr;
    }
}