/* ============================================================
   Cookie Consent Banner — FrançaisPro
   À ajouter dans assets/css/main.css ou vip.css
   ============================================================ */

/* Bandeau principal */
#cookieBanner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #111827;
    border-top: 1px solid rgba(79,124,245,0.25);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
    padding: 20px 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
    display: none;
}
#cookieBanner.show {
    display: block;
    transform: translateY(0);
}
.cookie-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-icon { font-size: 2rem; flex-shrink: 0; }
.cookie-text { flex: 1; min-width: 240px; }
.cookie-text h3 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 4px;
}
.cookie-text p {
    color: #94a3b8;
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.6;
}
.cookie-text a { color: #4f7cf5; text-decoration: none; }
.cookie-text a:hover { text-decoration: underline; }
.cookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.cookie-btn-accept {
    background: linear-gradient(135deg, #4f7cf5, #7c3aed);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .2s;
    white-space: nowrap;
}
.cookie-btn-accept:hover { opacity: 0.9; }
.cookie-btn-refuse {
    background: transparent;
    color: #64748b;
    border: 1px solid #2d3748;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    white-space: nowrap;
}
.cookie-btn-refuse:hover { border-color: #4b5563; color: #94a3b8; }
.cookie-btn-settings {
    background: transparent;
    color: #4f7cf5;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .2s;
    white-space: nowrap;
    text-decoration: underline;
}
.cookie-btn-settings:hover { opacity: 0.8; }

/* Modale paramètres */
#cookieModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#cookieModal.show { display: flex; }
.cookie-modal-box {
    background: #1a1d2e;
    border: 1px solid #2d3748;
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    overflow-y: auto;
}
.cookie-modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cookie-modal-header h2 { color: #fff; font-size: 1.1rem; font-weight: 800; margin: 0; }
.cookie-modal-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.cookie-modal-close:hover { color: #fff; }
.cookie-modal-body { padding: 20px 24px; }
.cookie-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #2d3748;
}

/* Toggle switch */
.cookie-toggle-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #1e293b;
}
.cookie-toggle-row:last-child { border-bottom: none; }
.cookie-toggle-info h4 { color: #e2e8f0; font-size: 0.88rem; font-weight: 700; margin: 0 0 4px; }
.cookie-toggle-info p  { color: #64748b; font-size: 0.78rem; margin: 0; line-height: 1.5; }
.cookie-required-badge {
    font-size: 0.65rem; font-weight: 700; padding: 2px 7px;
    background: rgba(34,197,94,0.12); color: #22c55e;
    border-radius: 20px; margin-left: 6px; vertical-align: middle;
}

/* Toggle switch UI */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #2d3748;
    border-radius: 24px;
    cursor: pointer;
    transition: background .2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: #4f7cf5; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* Bouton rouvrir (coin bas-gauche) */
#cookieReopenBtn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    background: #1a1d2e;
    border: 1px solid #2d3748;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    display: none;
}
#cookieReopenBtn:hover { border-color: #4f7cf5; color: #4f7cf5; }

@media (max-width: 640px) {
    .cookie-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
    .cookie-actions { width: 100%; }
    .cookie-btn-accept, .cookie-btn-refuse { flex: 1; text-align: center; }
}
