/* ════════════════════════════════════════════════════════
   Cookie Consent Kit — CSS autonome
   ════════════════════════════════════════════════════════
   Prérequis : définir ces CSS variables dans :root
   :root {
       --brand-400: #b894f6;
       --accent-400: #ffc83e;
   }
   ════════════════════════════════════════════════════════ */

/* ── Banner (Layer 1) ───────────────────────────────── */
.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    pointer-events: none;
}
.cc-banner.cc-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.cc-banner-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99980;
    background: rgba(5, 15, 33, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.cc-banner-backdrop.cc-visible {
    opacity: 1;
    pointer-events: auto;
}
.cc-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    background: rgba(11, 29, 63, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(61, 113, 203, 0.28);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.cc-banner-content {
    flex: 1;
    min-width: 280px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.cc-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}
.cc-banner-text strong {
    display: block;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.cc-banner-text p {
    color: #9ca3af;
    font-size: 0.82rem;
    line-height: 1.6;
    margin: 0;
}
.cc-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────────── */
.cc-btn {
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: "Work Sans", system-ui, sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.cc-btn-accept {
    background: linear-gradient(135deg, var(--accent-400), #b08a5e);
    color: #fff;
    box-shadow: 0 2px 12px rgba(200, 169, 126, 0.35);
}
.cc-btn-accept:hover {
    box-shadow: 0 4px 20px rgba(200, 169, 126, 0.45);
    transform: translateY(-1px);
}
.cc-btn-reject {
    background: transparent;
    color: #d9e2f5;
    border: 1px solid rgba(217, 226, 245, 0.25);
}
.cc-btn-reject:hover {
    color: #fff;
    border-color: rgba(217, 226, 245, 0.5);
}
.cc-btn-customize {
    background: transparent;
    color: #d9e2f5;
    border: 1px solid rgba(61, 113, 203, 0.5);
}
.cc-btn-customize:hover {
    background: rgba(61, 113, 203, 0.18);
    border-color: rgba(61, 113, 203, 0.8);
}
.cc-btn-save {
    background: linear-gradient(135deg, var(--brand-400), #2d5ca8);
    color: #fff;
    box-shadow: 0 2px 12px rgba(61, 113, 203, 0.35);
}
.cc-btn-save:hover {
    box-shadow: 0 4px 20px rgba(61, 113, 203, 0.45);
    transform: translateY(-1px);
}

/* ── Preferences Panel (Layer 2) ────────────────────── */
.cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.cc-overlay.cc-visible {
    opacity: 1;
    pointer-events: auto;
}
.cc-overlay.cc-visible .cc-prefs-panel {
    transform: translateY(0) scale(1);
}
.cc-prefs-panel {
    width: 660px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    background: #0b1d3f;
    border: 1px solid rgba(61, 113, 203, 0.28);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header */
.cc-prefs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(61, 113, 203, 0.2);
}
.cc-prefs-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.cc-prefs-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.cc-prefs-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Intro text */
.cc-prefs-intro {
    padding: 16px 24px;
    font-size: 0.82rem;
    color: #9ca3af;
    line-height: 1.6;
}
.cc-prefs-intro p { margin: 0; }
.cc-link {
    color: var(--brand-400);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cc-link:hover { color: #e2d3b4; }

/* Categories */
.cc-prefs-categories {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 16px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
.cc-prefs-categories::-webkit-scrollbar { width: 4px; }
.cc-prefs-categories::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.cc-category {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.cc-category:hover {
    border-color: rgba(61, 113, 203, 0.3);
}
.cc-category-required {
    border-color: rgba(200, 169, 126, 0.4);
    background: rgba(200, 169, 126, 0.08);
}
.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
}
.cc-category-info {
    flex: 1;
    min-width: 0;
}
.cc-category-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px;
}
.cc-category-info p {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.5;
    margin: 0;
}

/* Required badge */
.cc-required-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(200, 169, 126, 0.2);
    color: #e2d3b4;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(200, 169, 126, 0.45);
}

/* Toggle switch */
.cc-toggle-wrap {
    flex-shrink: 0;
    position: relative;
}
.cc-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.cc-toggle-slider {
    display: block;
    width: 48px;
    height: 26px;
    border-radius: 13px;
    background: #374151;
    cursor: pointer;
    position: relative;
    transition: background 0.3s;
}
.cc-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.cc-toggle-input:checked + .cc-toggle-slider {
    background: linear-gradient(135deg, var(--brand-400), #2d5ca8);
}
.cc-toggle-input:checked + .cc-toggle-slider::after {
    transform: translateX(22px);
}
.cc-toggle-input:focus-visible + .cc-toggle-slider {
    outline: 2px solid var(--brand-400);
    outline-offset: 2px;
}

/* Cookie details table */
.cc-category-footer {
    padding: 0 16px 12px;
}
.cc-details-toggle {
    background: none;
    border: none;
    color: var(--brand-400);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cc-details-toggle:hover { color: #e2d3b4; }

.cc-cookie-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.cc-cookie-details.cc-open {
    max-height: 300px;
}
.cc-cookie-details table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    margin-top: 8px;
}
.cc-cookie-details th {
    text-align: left;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cc-cookie-details td {
    padding: 6px 10px;
    color: #9ca3af;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.cc-cookie-name {
    font-family: 'Courier New', monospace;
    color: #e2d3b4;
    font-weight: 600;
}

/* Prefs footer */
.cc-prefs-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid rgba(61, 113, 203, 0.2);
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Floating settings button ───────────────────────── */
.cc-settings-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 24px;
    background: rgba(11, 29, 63, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(61, 113, 203, 0.35);
    color: #d9e2f5;
    font-size: 0.75rem;
    font-family: "Work Sans", system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.35s ease;
}
.cc-settings-btn.cc-visible {
    opacity: 1;
    transform: translateY(0);
}
.cc-settings-btn:hover {
    color: #fff;
    border-color: rgba(200, 169, 126, 0.75);
    box-shadow: 0 4px 16px rgba(11, 29, 63, 0.35);
}
.cc-settings-btn svg {
    flex-shrink: 0;
}
.cc-settings-label {
    font-weight: 500;
}

/* ── Mobile responsive ──────────────────────────────── */
@media (max-width: 640px) {
    .cc-banner-inner {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }
    .cc-banner-content {
        flex-direction: column;
        gap: 10px;
    }
    .cc-banner-actions {
        width: 100%;
        flex-direction: column;
    }
    .cc-banner-actions .cc-btn {
        width: 100%;
        text-align: center;
    }
    .cc-prefs-panel {
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
    }
    .cc-prefs-footer {
        flex-direction: column;
    }
    .cc-prefs-footer .cc-btn {
        width: 100%;
        text-align: center;
    }
    .cc-settings-btn {
        bottom: 16px;
        left: 16px;
    }
}
