/* ============================================================
   COOKIE CONSENT — LokWeb
   Bandeau RGPD + modale de personnalisation (thème dark)
   Charte : --primary (bleu) #2F5CFF, --accent (ambre) #F59E0B
   ============================================================ */

/* ---- Bandeau principal (bottom) ---- */
.cc-banner {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    z-index: 1000;
    width: calc(100% - 32px);
    max-width: 720px;
    background: var(--bg-dark, #0B0F1A);
    color: var(--text-on-dark, #E7E5DF);
    border: 1px solid var(--border-dark, #1E2230);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    padding: 22px 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .28s ease, transform .28s ease, visibility .28s;
}

.cc-banner.cc-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.cc-title {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0 0 8px;
    color: var(--white, #fff);
}

.cc-text {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-weight: 400;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--text-on-dark, #E7E5DF);
    margin: 0 0 18px;
}

/* ---- Rangée de boutons ---- */
.cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.cc-btn {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-weight: 600;
    font-size: .9rem;
    line-height: 1;
    padding: 12px 18px;
    border-radius: var(--radius, 10px);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
    white-space: nowrap;
}

.cc-btn:active { transform: translateY(1px); }

.cc-btn:focus-visible {
    outline: 2px solid var(--primary, #2F5CFF);
    outline-offset: 2px;
}

/* Tout refuser — neutre */
.cc-btn--refuse {
    background: transparent;
    color: var(--text-on-dark, #E7E5DF);
    border-color: var(--border-dark, #1E2230);
}
.cc-btn--refuse:hover {
    border-color: #3a3f52;
    background: rgba(255, 255, 255, 0.04);
}

/* Personnaliser — secondaire */
.cc-btn--custom {
    background: transparent;
    color: var(--white, #fff);
    border-color: #3a3f52;
}
.cc-btn--custom:hover {
    border-color: #555c75;
    background: rgba(255, 255, 255, 0.06);
}

/* Tout accepter — primaire ambre LokWeb */
.cc-btn--accept {
    background: var(--accent, #F59E0B);
    color: #1a1206;
    border-color: var(--accent, #F59E0B);
    margin-left: auto;
}
.cc-btn--accept:hover {
    background: #D97706;
    border-color: #D97706;
}

/* Lien politique de confidentialité */
.cc-link {
    display: inline-block;
    margin-top: 14px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: .82rem;
    color: var(--text-muted-on-dark, #8B8F9A);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cc-link:hover { color: var(--white, #fff); }

/* ---- Overlay + modale de personnalisation ---- */
.cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(4, 6, 12, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s;
}
.cc-overlay.cc-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cc-modal {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--bg-dark, #0B0F1A);
    color: var(--text-on-dark, #E7E5DF);
    border: 1px solid var(--border-dark, #1E2230);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    padding: 28px;
    transform: translateY(12px);
    transition: transform .25s ease;
}
.cc-overlay.cc-visible .cc-modal { transform: translateY(0); }

.cc-modal-title {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--white, #fff);
    margin: 0 0 6px;
}
.cc-modal-intro {
    font-size: .9rem;
    line-height: 1.55;
    color: var(--text-on-dark, #E7E5DF);
    margin: 0 0 20px;
}

/* Catégorie */
.cc-cat {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border-dark, #1E2230);
}
.cc-cat:last-of-type { border-bottom: 1px solid var(--border-dark, #1E2230); }

.cc-cat-name {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-weight: 600;
    font-size: .95rem;
    color: var(--white, #fff);
    margin: 0 0 4px;
}
.cc-cat-desc {
    font-size: .82rem;
    line-height: 1.5;
    color: var(--text-muted-on-dark, #8B8F9A);
    margin: 0;
}

/* Interrupteur (toggle) */
.cc-switch {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 26px;
    display: inline-block;
}
.cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.cc-slider {
    position: absolute;
    inset: 0;
    background: #2a2f42;
    border-radius: 999px;
    transition: background .2s ease;
    cursor: pointer;
}
.cc-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--white, #fff);
    border-radius: 50%;
    transition: transform .2s ease;
}
.cc-switch input:checked + .cc-slider {
    background: var(--primary, #2F5CFF);
}
.cc-switch input:checked + .cc-slider::before {
    transform: translateX(20px);
}
.cc-switch input:focus-visible + .cc-slider {
    outline: 2px solid var(--primary, #2F5CFF);
    outline-offset: 2px;
}
/* Catégorie nécessaire — verrouillée */
.cc-switch input:disabled + .cc-slider {
    background: var(--primary, #2F5CFF);
    opacity: .55;
    cursor: not-allowed;
}

.cc-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}
.cc-modal-actions .cc-btn--save {
    background: var(--primary, #2F5CFF);
    color: var(--white, #fff);
    border-color: var(--primary, #2F5CFF);
    margin-left: auto;
}
.cc-modal-actions .cc-btn--save:hover {
    background: var(--primary-hover, #1A45E0);
    border-color: var(--primary-hover, #1A45E0);
}

/* ---- Lien "Gérer mes cookies" dans le footer ---- */
.cc-manage-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
}
.cc-manage-btn:hover { text-decoration: underline; }

/* ---- Responsive ---- */
@media (max-width: 560px) {
    .cc-banner { padding: 18px; bottom: 12px; }
    .cc-actions { flex-direction: column; align-items: stretch; }
    .cc-btn { width: 100%; text-align: center; }
    .cc-btn--accept { margin-left: 0; }
    .cc-modal-actions { flex-direction: column; }
    .cc-modal-actions .cc-btn--save { margin-left: 0; }
}

/* Respecte les préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .cc-banner, .cc-overlay, .cc-modal { transition: none; }
}
