/**
 * consent.css — Bannière de consentement cookies Anacours
 *
 * Palette :
 *   #4251FF  — bleu principal (CTA accept)
 *   #333F48  — gris foncé (texte, CTA refuse)
 *   #FFD100  — jaune (logo, accents)
 *   #F5F5F7  — gris très clair (fond carte)
 *   #FFFFFF  — blanc
 *
 * Structure :
 *   .ana-consent-banner        — wrapper plein écran (overlay + carte)
 *   .ana-consent-overlay       — fond semi-transparent
 *   .ana-consent-card          — fenêtre modale centrée
 *     #ana-consent-main        — vue principale
 *     #ana-consent-custom      — vue personnaliser (hidden par défaut)
 */

/* ── Reset minimal ────────────────────────────────────────────────────────── */

.ana-consent-banner *,
.ana-consent-banner *::before,
.ana-consent-banner *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */

.ana-consent-banner {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.ana-consent-banner[hidden] {
    display: none !important;
}

/* ── Overlay ──────────────────────────────────────────────────────────────── */

.ana-consent-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

/* ── Carte ────────────────────────────────────────────────────────────────── */

.ana-consent-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

/* ── Logo ─────────────────────────────────────────────────────────────────── */

.ana-consent-logo {
    font-size: 22px;
    font-weight: 800;
    color: #333F48;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    line-height: 1;
}

/* Logo image (quand défini depuis le BO) */
.ana-consent-logo-img {
    display: block;
    max-height: 36px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

/* ── Titre ────────────────────────────────────────────────────────────────── */

.ana-consent-title {
    font-size: 18px;
    font-weight: 700;
    color: #333F48;
    line-height: 1.3;
    margin-bottom: 10px;
}

/* ── Description ──────────────────────────────────────────────────────────── */

.ana-consent-desc {
    font-size: 13.5px;
    color: #555;
    line-height: 1.55;
    margin-bottom: 20px;
}

/* ── Boutons principaux ───────────────────────────────────────────────────── */

.ana-consent-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ana-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    line-height: 1.2;
    text-align: center;
}

.ana-btn:hover {
    opacity: 0.88;
}

.ana-btn:active {
    transform: scale(0.97);
}

.ana-btn-accept {
    background: #4251FF;
    color: #fff;
}

.ana-btn-refuse {
    background: #F0F0F2;
    color: #333F48;
}

.ana-btn-refuse:hover {
    background: #E4E4E8;
    opacity: 1;
}

/* ── Lien "Personnaliser" ─────────────────────────────────────────────────── */

.ana-btn-customize {
    display: block;
    background: none;
    border: none;
    color: #4251FF;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-top: 14px;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.15s;
}

.ana-btn-customize:hover {
    opacity: 0.75;
}

/* ── Liens légaux ─────────────────────────────────────────────────────────── */

.ana-consent-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.ana-consent-links a {
    font-size: 12px;
    color: #888;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.ana-consent-links a:hover {
    color: #555;
}

/* ── Vue personnaliser — bouton Retour ────────────────────────────────────── */

.ana-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.ana-btn-back:hover {
    color: #333F48;
}

/* ── Lignes de toggle ─────────────────────────────────────────────────────── */

.ana-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #EBEBEB;
}

.ana-toggle-row:last-of-type {
    border-bottom: none;
}

.ana-toggle-info {
    flex: 1;
    min-width: 0;
}

.ana-toggle-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333F48;
    margin-bottom: 2px;
}

.ana-toggle-info span {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

/* ── Toggle switch ────────────────────────────────────────────────────────── */

.ana-toggle-wrap {
    flex-shrink: 0;
}

/* Input caché — accessible par label */
.ana-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Label = le toggle visuel */
.ana-toggle {
    display: block;
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: #D0D0D6;
    cursor: pointer;
    transition: background 0.2s;
}

.ana-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

/* État coché */
.ana-toggle-input:checked + .ana-toggle {
    background: #4251FF;
}

.ana-toggle-input:checked + .ana-toggle::after {
    transform: translateX(20px);
}

/* Focus clavier */
.ana-toggle-input:focus-visible + .ana-toggle {
    outline: 2px solid #4251FF;
    outline-offset: 2px;
}

/* ── Toggle verrouillé (Fonctionnels — toujours actif) ────────────────────── */

.ana-toggle-locked {
    background: #4251FF;
    cursor: not-allowed;
    opacity: 0.5;
}

.ana-toggle-locked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transform: translateX(20px);
}

/* ── Vue personnaliser — actions ──────────────────────────────────────────── */

#ana-consent-custom .ana-consent-actions {
    margin-top: 20px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .ana-consent-card {
        padding: 24px 20px 20px;
        border-radius: 12px;
    }

    .ana-consent-actions {
        flex-direction: column;
    }

    .ana-btn {
        flex: none;
        width: 100%;
    }
}
