/* ================================================================
   QUOTIO — Bandeau de consentement cookies (RGPD)
   Hérite des tokens de styles.css.
   ================================================================ */

.cookie-banner {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    max-width: 680px;
    margin: 0 auto;
    background: var(--surface-hi, #fff);
    color: var(--text, #1A2F2B);
    border: 1px solid var(--border, #C9D6D3);
    border-radius: 16px;
    box-shadow: 0 18px 48px -20px rgba(26, 47, 43, 0.35);
    padding: 20px 22px 18px;
    font-family: var(--font-body, sans-serif);
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .28s ease;
}
.cookie-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-banner-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.cookie-banner-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent-soft, rgba(15, 118, 110, 0.1));
    color: var(--accent, #0F766E);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cookie-banner-title {
    font-family: var(--font-display, sans-serif);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

.cookie-banner-text {
    margin: 0 0 16px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-muted, #5E7A74);
}
.cookie-banner-text a {
    color: var(--accent, #0F766E);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.cookie-banner-text a:hover { color: var(--accent-deep, #0D5B54); }

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}
.cookie-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
    font-family: inherit;
}
.cookie-btn:active { transform: translateY(1px); }

.cookie-btn--accept {
    background: var(--accent, #0F766E);
    color: #fff;
}
.cookie-btn--accept:hover { background: var(--accent-deep, #0D5B54); }

.cookie-btn--reject {
    background: transparent;
    color: var(--text, #1A2F2B);
    border-color: var(--border, #C9D6D3);
}
.cookie-btn--reject:hover {
    border-color: var(--accent, #0F766E);
    color: var(--accent, #0F766E);
    background: var(--accent-soft, rgba(15, 118, 110, 0.08));
}

.cookie-btn--customize {
    background: transparent;
    color: var(--text-muted, #5E7A74);
    border: none;
    padding: 9px 10px;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.cookie-btn--customize:hover { color: var(--accent, #0F766E); }

/* ---- Mode personnalisation ---- */
.cookie-banner.is-custom .cookie-banner-actions-main { display: none; }
.cookie-banner:not(.is-custom) .cookie-categories { display: none; }

.cookie-categories {
    margin: 4px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}
.cookie-category {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface, #E4ECEB);
    border-radius: 10px;
    align-items: flex-start;
}
.cookie-category-body { flex: 1; min-width: 0; }
.cookie-category-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text, #1A2F2B);
    margin: 0 0 3px;
}
.cookie-category-desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted, #5E7A74);
    line-height: 1.5;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 1px;
}
.cookie-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.cookie-toggle input:disabled { cursor: not-allowed; }
.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border, #C9D6D3);
    border-radius: 999px;
    transition: background .2s ease;
}
.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.cookie-toggle input:checked ~ .cookie-toggle-slider {
    background: var(--accent, #0F766E);
}
.cookie-toggle input:checked ~ .cookie-toggle-slider::before {
    transform: translateX(16px);
}
.cookie-toggle input:disabled ~ .cookie-toggle-slider {
    opacity: 0.6;
    background: var(--accent, #0F766E);
}

/* ---- Responsive ---- */
@media (max-width: 560px) {
    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 18px 18px 16px;
        border-radius: 14px;
    }
    .cookie-banner-actions { justify-content: stretch; }
    .cookie-banner-actions .cookie-btn--accept,
    .cookie-banner-actions .cookie-btn--reject { flex: 1; justify-content: center; }
    .cookie-btn--customize { width: 100%; justify-content: center; }
}
