/* ═══════════════════════════════════════════════════════════════════════════
   cookie-consent.css
   Fichier : public/css/cookie-consent.css
   
   Bannière de consentement cookies — NUM-ECARD
   Conforme RGPD : Accepter / Refuser / Personnaliser
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── VARIABLES (reprend la charte NUM-ECARD) ─── */
:root {
    --ck-primary: #2563eb;
    --ck-primary-dark: #1d4ed8;
    --ck-secondary: #10b981;
    --ck-dark: #1e293b;
    --ck-gray: #64748b;
    --ck-light: #f8fafc;
    --ck-border: #e2e8f0;
    --ck-white: #ffffff;
    --ck-radius: 12px;
    --ck-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12);
    --ck-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ═══════════════════════════════════════════════════
   OVERLAY ASSOMBRI
   ═══════════════════════════════════════════════════ */
.cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9998;
    backdrop-filter: blur(2px);
    display: none;
}

.cookie-overlay.active {
    display: block;
    animation: ckFadeIn 0.4s ease;
}

/* ═══════════════════════════════════════════════════
   BANNIÈRE PRINCIPALE
   ═══════════════════════════════════════════════════ */
.cookie-banner {
    position: fixed;
    bottom: 71px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 94%;
    max-width: 820px;
    background: var(--ck-white);
    border-radius: var(--ck-radius);
    box-shadow: var(--ck-shadow);
    border: 1px solid var(--ck-border);
    overflow: hidden;
    display: none;
    font-family: var(--ck-font);
}

.cookie-banner.active {
    display: block;
    animation: ckSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.closing {
    animation: ckSlideDown 0.3s ease forwards;
}

/* Barre d'accent supérieure (gradient bleu → vert) */
.cookie-accent-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--ck-primary), var(--ck-secondary));
}

/* ─── Layout intérieur ─── */
.cookie-inner {
    padding: 28px 32px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ─── Icône ─── */
.cookie-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.25);
}

/* ─── Titre ─── */
.cookie-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ck-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ck-primary);
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ─── Texte ─── */
.cookie-text {
    font-size: 0.85rem;
    color: var(--ck-gray);
    line-height: 1.65;
    margin-bottom: 20px;
}

.cookie-link {
    color: var(--ck-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.cookie-link:hover {
    color: var(--ck-primary-dark);
}

/* ═══════════════════════════════════════════════════
   BOUTONS D'ACTION
   ═══════════════════════════════════════════════════ */
.cookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-btn {
    font-family: var(--ck-font);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.2px;
}

/* ✅ ACCEPTER — Bouton principal bleu */
.cookie-btn--accept {
    background: var(--ck-primary);
    color: var(--ck-white);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}

.cookie-btn--accept:hover {
    background: var(--ck-primary-dark);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.cookie-btn--accept:active {
    transform: translateY(0);
}

/* ❌ REFUSER — Bouton blanc bordé (même visibilité que Accepter — RGPD) */
.cookie-btn--refuse {
    background: var(--ck-white);
    color: var(--ck-dark);
    border: 1.5px solid var(--ck-border);
}

.cookie-btn--refuse:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* ⚙️ PERSONNALISER — Lien discret */
.cookie-btn--settings {
    background: transparent;
    color: var(--ck-gray);
    font-weight: 500;
    padding: 10px 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 0.8rem;
}

.cookie-btn--settings:hover {
    color: var(--ck-primary);
}

/* ═══════════════════════════════════════════════════
   PANNEAU DE PERSONNALISATION
   ═══════════════════════════════════════════════════ */
.cookie-settings {
    display: none;
    border-top: 1px solid var(--ck-border);
    padding: 24px 32px;
    background: var(--ck-light);
}

.cookie-settings.open {
    display: block;
    animation: ckFadeIn 0.3s ease;
}

.cookie-settings-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ck-dark);
    margin-bottom: 16px;
    font-family: var(--ck-font);
}

/* ─── Ligne d'option ─── */
.cookie-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--ck-border);
}

.cookie-option:last-of-type {
    border-bottom: none;
}

.cookie-option-info {
    flex: 1;
}

.cookie-option-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ck-dark);
    margin-bottom: 2px;
    font-family: var(--ck-font);
}

.cookie-option-desc {
    font-size: 0.75rem;
    color: var(--ck-gray);
    line-height: 1.5;
    font-family: var(--ck-font);
}

.cookie-required-tag {
    font-size: 0.65rem;
    color: var(--ck-secondary);
    font-weight: 600;
    background: #ecfdf5;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

/* ─── Toggle switch ─── */
.cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 16px;
    display: inline-block;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.25s ease;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: var(--ck-primary);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(20px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background: var(--ck-primary);
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-toggle input:disabled + .cookie-toggle-slider::before {
    transform: translateX(20px);
}

/* ─── Bouton enregistrer dans le panneau ─── */
.cookie-settings-save {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════
   BOUTON FLOTTANT (ré-ouvrir les préférences)
   ═══════════════════════════════════════════════════ */
.cookie-reopen-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9990;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--ck-border);
    background: var(--ck-white);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cookie-reopen-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes ckFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ckSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes ckSlideDown {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE MOBILE
   ═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .cookie-banner {
        bottom: 71px;
        width: 96%;
        border-radius: 10px;
    }

    .cookie-inner {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }

    .cookie-actions {
        width: 100%;
    }

    .cookie-btn--accept,
    .cookie-btn--refuse {
        flex: 1;
        text-align: center;
    }

    .cookie-btn--settings {
        width: 100%;
        text-align: center;
    }

    .cookie-settings {
        padding: 16px 20px;
    }

    .cookie-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cookie-toggle {
        margin-left: 0;
    }
}
