/*
 * Cookie Banner - IA FRANCE
 * Style coherent avec le design system existant
 */

/* === BANNIERE BAS === */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
    animation: cookie-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.cookie-banner[hidden] { display: none; }

@keyframes cookie-slide-up {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 280px;
}

.cookie-banner-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner-title {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.01em;
}

.cookie-banner-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #4a4a4f;
}
.cookie-banner-desc a {
    color: #0066cc;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-banner-desc a:hover {
    color: #0a84ff;
}

.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* === BOUTONS === */
.cookie-btn {
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
}
.cookie-btn:active {
    transform: translateY(0);
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #0a84ff, #0066cc);
    color: #fff;
    box-shadow: 0 1px 2px rgba(10, 132, 255, 0.18);
}
.cookie-btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.32);
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background: #fff;
    color: #1d1d1f;
    border-color: rgba(0, 0, 0, 0.12);
}
.cookie-btn-secondary:hover {
    background: #f5f5f7;
    border-color: rgba(0, 0, 0, 0.18);
}

.cookie-btn-ghost {
    background: transparent;
    color: #4a4a4f;
}
.cookie-btn-ghost:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1d1d1f;
}

/* === MODAL PERSONNALISATION === */
.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cookie-fade-in 0.2s ease;
}
.cookie-modal[hidden] { display: none; }

@keyframes cookie-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cookie-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.cookie-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 540px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
    animation: cookie-modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes cookie-modal-pop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cookie-modal-header {
    padding: 20px 24px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.cookie-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.01em;
}

.cookie-modal-close {
    background: transparent;
    border: 0;
    color: #6e6e73;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
    transition: background 0.15s ease, color 0.15s ease;
}
.cookie-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1d1d1f;
}

.cookie-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.cookie-modal-intro {
    margin: 0 0 18px 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: #4a4a4f;
}

.cookie-category {
    padding: 14px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.cookie-category:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 6px;
}

.cookie-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #1d1d1f;
}
.cookie-category-title strong {
    font-weight: 600;
}

.cookie-category-badge {
    background: #f0f0f2;
    color: #6e6e73;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

.cookie-category-desc {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: #6e6e73;
    padding-right: 60px;
}

/* === SWITCH === */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.cookie-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #d2d2d7;
    transition: 0.25s;
    border-radius: 999px;
}
.cookie-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.25s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.cookie-switch input:checked + .cookie-switch-slider {
    background: linear-gradient(135deg, #0a84ff, #0066cc);
}
.cookie-switch input:checked + .cookie-switch-slider:before {
    transform: translateX(20px);
}
.cookie-switch input:disabled + .cookie-switch-slider {
    background-color: #b8b8be;
    cursor: not-allowed;
    opacity: 0.7;
}
.cookie-switch-disabled .cookie-switch-slider {
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* === MOBILE === */
@media (max-width: 768px) {
    .cookie-banner-inner {
        padding: 14px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .cookie-banner-actions {
        width: 100%;
        flex-direction: column-reverse;
        gap: 6px;
    }
    .cookie-banner-actions .cookie-btn {
        width: 100%;
        padding: 11px 14px;
    }
    .cookie-banner-icon {
        font-size: 22px;
    }
    .cookie-banner-title {
        font-size: 14px;
    }
    .cookie-banner-desc {
        font-size: 12.5px;
    }
    .cookie-modal-content {
        max-height: 92vh;
    }
    .cookie-category-desc {
        padding-right: 0;
    }
    .cookie-modal-footer {
        flex-direction: column-reverse;
    }
    .cookie-modal-footer .cookie-btn {
        width: 100%;
        padding: 11px 14px;
    }
}

/* === DARK MODE AUTO === */
@media (prefers-color-scheme: dark) {
    .cookie-banner {
        background: rgba(28, 28, 30, 0.97);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    .cookie-banner-title { color: #f5f5f7; }
    .cookie-banner-desc { color: #c7c7cc; }
    .cookie-banner-desc a { color: #0a84ff; }
    .cookie-btn-secondary {
        background: #1c1c1e;
        color: #f5f5f7;
        border-color: rgba(255, 255, 255, 0.14);
    }
    .cookie-btn-secondary:hover {
        background: #2c2c2e;
    }
    .cookie-btn-ghost { color: #c7c7cc; }
    .cookie-btn-ghost:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #f5f5f7;
    }
    .cookie-modal-content {
        background: #1c1c1e;
    }
    .cookie-modal-header h2,
    .cookie-category-title { color: #f5f5f7; }
    .cookie-modal-header,
    .cookie-category,
    .cookie-modal-footer {
        border-color: rgba(255, 255, 255, 0.08);
    }
    .cookie-modal-intro,
    .cookie-category-desc { color: #c7c7cc; }
    .cookie-category-badge {
        background: #2c2c2e;
        color: #c7c7cc;
    }
    .cookie-modal-close { color: #c7c7cc; }
    .cookie-modal-close:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #f5f5f7;
    }
    .cookie-switch-slider { background-color: #48484a; }
}
