/* =====================================================
   SYSTÈME DE CONSENTEMENT AUX COOKIES - FLOTTE360
   Design Vroomly - Conforme RGPD / CNIL
   ===================================================== */

/* ==================== OVERLAY ==================== */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cookie-overlay.active {
    display: block;
    opacity: 1;
}

/* ==================== BANDEAU PRINCIPAL ==================== */
.cookie-consent-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-width: 680px;
    width: 90%;
    z-index: 9999;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.cookie-consent-banner.active {
    display: block;
}

/* En-tête simple et sobre style Vroomly */
.cookie-banner-header {
    padding: 32px 32px 0 32px;
    position: relative;
}

.cookie-banner-icon {
    font-size: 32px;
    display: inline-block;
    margin-bottom: 16px;
}

.cookie-banner-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #1a1a1a;
    line-height: 1.3;
    padding-right: 180px;
}

/* Lien "Continuer sans accepter" en haut à droite comme Vroomly */
.cookie-continue-link {
    position: absolute;
    top: 32px;
    right: 32px;
    font-size: 14px;
    color: #666666;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    font-weight: 400;
}

.cookie-continue-link:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

/* Contenu */
.cookie-banner-content {
    padding: 0 32px 32px 32px;
}

.cookie-banner-text {
    color: #4a4a4a;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
    font-weight: 400;
}

.cookie-banner-text p {
    margin-bottom: 12px;
}

.cookie-banner-text a {
    color: #0066ff;
    text-decoration: none;
    font-weight: 500;
}

.cookie-banner-text a:hover {
    text-decoration: underline;
}

/* Boutons d'action - Style Vroomly */
.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-direction: row-reverse;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

/* Bouton principal noir (Accepter et fermer) */
.cookie-btn-primary {
    background: #1a1a1a;
    color: #ffffff;
    flex: 1;
}

.cookie-btn-primary:hover {
    background: #000000;
}

/* Bouton secondaire blanc bordé (Paramétrer) */
.cookie-btn-secondary {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #d4d4d4;
    flex: 1;
}

.cookie-btn-secondary:hover {
    background: #f5f5f5;
    border-color: #b8b8b8;
}

/* Boutons cachés (gérés par le lien "Continuer") */
.cookie-btn-outline,
.cookie-btn-text {
    display: none;
}

/* ==================== FENÊTRE DE PARAMÉTRAGE ==================== */
.cookie-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-width: 680px;
    width: 90%;
    max-height: 85vh;
    z-index: 9999;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
}

.cookie-settings-modal.active {
    display: flex;
    flex-direction: column;
}

/* En-tête modal sobre style Vroomly */
.cookie-settings-header {
    padding: 32px 32px 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
    border-bottom: 1px solid #e8e8e8;
}

.cookie-settings-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
}

.cookie-settings-close {
    background: transparent;
    border: none;
    color: #666666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cookie-settings-close:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

/* Contenu défilable */
.cookie-settings-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.cookie-settings-intro {
    color: #4a4a4a;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
    font-weight: 400;
}

.cookie-settings-intro a {
    color: #0066ff;
    text-decoration: none;
}

.cookie-settings-intro a:hover {
    text-decoration: underline;
}

/* Catégories de cookies - Style sobre Vroomly */
.cookie-category {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.cookie-category:hover {
    border-color: #d4d4d4;
}

.cookie-category-header {
    padding: 16px 20px;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.cookie-category-header:hover {
    background: #fafafa;
}

.cookie-category-header.disabled {
    cursor: default;
}

.cookie-category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.cookie-category-title h3 {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    color: #1a1a1a;
}

.cookie-required-badge {
    background: transparent;
    color: #dc3545;
    font-size: 13px;
    padding: 0;
    font-weight: 500;
}

/* Toggle Switch - Style Vroomly */
.cookie-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    background: #e0e0e0;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cookie-toggle.active {
    background: #4caf50;
}

.cookie-toggle.disabled {
    background: #4caf50;
    cursor: not-allowed;
    opacity: 0.7;
}

.cookie-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cookie-toggle.active .cookie-toggle-slider {
    transform: translateX(22px);
}

/* Icône chevron simple */
.cookie-category-chevron {
    margin-left: 12px;
    transition: transform 0.2s ease;
    color: #999999;
    font-size: 14px;
}

.cookie-category.expanded .cookie-category-chevron {
    transform: rotate(180deg);
}

/* Contenu dépliable */
.cookie-category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.cookie-category.expanded .cookie-category-content {
    max-height: 500px;
}

.cookie-category-inner {
    padding: 20px;
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
}

.cookie-category-description {
    color: #4a4a4a;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    font-weight: 400;
}

.cookie-services {
    background: #ffffff;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

.cookie-services h4 {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.cookie-services ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cookie-services li {
    color: #4a4a4a;
    font-size: 13px;
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
    font-weight: 400;
}

.cookie-services li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #999999;
}

/* Pied de modal - Style Vroomly */
.cookie-settings-footer {
    padding: 20px 32px;
    background: #ffffff;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-settings-footer .cookie-btn {
    flex: 1;
}

/* Hiérarchie des boutons dans les paramètres - Style Vroomly */
.cookie-settings-footer .cookie-btn-primary {
    background: #1a1a1a;
    color: #ffffff;
    order: 3;
}

.cookie-settings-footer .cookie-btn-secondary {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #d4d4d4;
    order: 2;
}

.cookie-settings-footer .cookie-btn-outline {
    display: block;
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #d4d4d4;
    order: 1;
}

/* Lien de gestion des cookies (footer) */
.cookie-manage-link {
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.cookie-manage-link:hover {
    text-decoration: underline;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .cookie-consent-banner {
        max-width: 100%;
        width: 100%;
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        border-radius: 16px 16px 0 0;
    }

    .cookie-banner-header {
        padding: 24px 20px 0 20px;
    }

    .cookie-banner-header h2 {
        padding-right: 0;
    }

    .cookie-continue-link {
        position: static;
        display: block;
        margin-bottom: 16px;
        text-align: right;
    }

    .cookie-banner-content {
        padding: 0 20px 24px 20px;
    }

    .cookie-banner-actions {
        flex-direction: column;
    }

    .cookie-settings-modal {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }

    .cookie-settings-header,
    .cookie-settings-body,
    .cookie-settings-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .cookie-settings-footer {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
    }
}

/* ==================== ACCESSIBILITÉ ==================== */
.cookie-btn:focus,
.cookie-toggle:focus,
.cookie-settings-close:focus,
.cookie-continue-link:focus {
    outline: 2px solid #0066ff;
    outline-offset: 2px;
}

.cookie-category-header:focus {
    outline: 2px solid #0066ff;
    outline-offset: -2px;
}

/* Réduction de mouvement pour accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


.cookie-banner-logo {
    height: 48px;          /* taille idéale */
    width: auto;
    margin-bottom: 12px;
    display: block;
}

/* Mobile */
@media (max-width: 480px) {
    .cookie-banner-logo {
        height: 40px;
        margin-bottom: 10px;
    }
}