/**
 * Cookie Consent Banner CSS
 * Conformité: RGPD + RGAA / WCAG 2.1 AA
 * Design: Cohérent avec landing.css
 */

/* ============================================
   BANNER DE CONSENTEMENT
   ============================================ */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  padding: 1.5rem 0;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-consent-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cookie-consent-content {
  flex: 1;
}

.cookie-consent-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1d2647;
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
}

.cookie-consent-description {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #666666;
  margin: 0;
}

.cookie-consent-link {
  color: #00d501;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.25s ease-in-out;
}

.cookie-consent-link:hover,
.cookie-consent-link:focus {
  color: #00cc00;
}

.cookie-consent-link:focus-visible {
  outline: 2px solid #00d501;
  outline-offset: 2px;
  border-radius: 2px;
}

.cookie-consent-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ============================================
   BOUTONS
   ============================================ */
.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  text-align: center;
  cursor: pointer;
  user-select: none;
  border: 2px solid transparent;
  padding: 0.625rem 1.5rem;
  border-radius: 0.25rem;
  transition: all 0.25s ease-in-out;
  white-space: nowrap;
}

.cookie-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.cookie-btn-accept {
  background-color: #00d501;
  border-color: #00d501;
  color: #000000;
}

.cookie-btn-accept:hover,
.cookie-btn-accept:focus {
  background-color: #00cc00;
  border-color: #00cc00;
  transform: translateY(-1px);
}

.cookie-btn-reject {
  background-color: #1a1f3a;
  border-color: #1a1f3a;
  color: #ffffff;
}

.cookie-btn-reject:hover,
.cookie-btn-reject:focus {
  background-color: #2a3354;
  border-color: #2a3354;
}

.cookie-btn-customize {
  background-color: transparent;
  border-color: #00d501;
  color: #1d2647;
}

.cookie-btn-customize:hover,
.cookie-btn-customize:focus {
  background-color: #00d501;
  color: #000000;
}

.cookie-btn-save {
  background-color: #00d501;
  border-color: #00d501;
  color: #000000;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.cookie-btn-save:hover,
.cookie-btn-save:focus {
  background-color: #00cc00;
  border-color: #00cc00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 213, 1, 0.3);
}

/* ============================================
   MODAL DE PERSONNALISATION
   ============================================ */
.cookie-consent-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-consent-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cookie-consent-modal-content {
  position: relative;
  background-color: #ffffff;
  border-radius: 0.5rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-consent-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #e8f3e6;
}

.cookie-consent-modal-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #1d2647;
  margin: 0;
  line-height: 1.3;
}

.cookie-consent-modal-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #666666;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.25s ease-in-out;
}

.cookie-consent-modal-close:hover,
.cookie-consent-modal-close:focus {
  background-color: #e8f3e6;
  color: #1d2647;
}

.cookie-consent-modal-close:focus-visible {
  outline: 2px solid #00d501;
  outline-offset: 2px;
}

.cookie-consent-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.cookie-consent-modal-intro {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #666666;
  margin: 0 0 1.5rem 0;
}

.cookie-consent-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e8f3e6;
}

/* ============================================
   CATÉGORIES DE COOKIES
   ============================================ */
.cookie-category {
  background-color: #f8fdf9;
  border: 1px solid #e8f3e6;
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.cookie-category:last-child {
  margin-bottom: 0;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.cookie-category-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-category-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1d2647;
  margin: 0;
  line-height: 1.3;
}

.cookie-category-badge {
  display: inline-block;
  background-color: #00d501;
  color: #000000;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.625rem;
  border-radius: 0.25rem;
}

.cookie-category-description {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #666666;
  margin: 0;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.cookie-category-toggle {
  flex-shrink: 0;
}

.cookie-toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  cursor: pointer;
}

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

.cookie-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cccccc;
  transition: all 0.3s ease-in-out;
  border-radius: 26px;
}

.cookie-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: all 0.3s ease-in-out;
  border-radius: 50%;
}

.cookie-toggle-input:checked + .cookie-toggle-slider {
  background-color: #00d501;
}

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

.cookie-toggle-input:focus-visible + .cookie-toggle-slider {
  outline: 2px solid #00d501;
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */

/* Tablets (≥768px) */
@media (min-width: 768px) {
  .cookie-consent-container {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }

  .cookie-consent-actions {
    flex-direction: row;
    flex-shrink: 0;
  }

  .cookie-btn-save {
    width: auto;
  }
}

/* ============================================
   ACCESSIBILITÉ RGAA
   ============================================ */

/* Désactiver les animations si préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner,
  .cookie-consent-modal-overlay,
  .cookie-consent-modal-content {
    animation: none !important;
  }

  .cookie-btn,
  .cookie-toggle-slider,
  .cookie-toggle-slider:before {
    transition: none !important;
  }
}

/* Contraste élevé */
@media (prefers-contrast: high) {
  .cookie-consent-banner {
    border-top: 3px solid #00d501;
  }

  .cookie-category {
    border-width: 2px;
  }

  .cookie-btn {
    border-width: 3px;
  }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
  .cookie-consent-banner {
    background-color: #1a1f3a;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  }

  .cookie-consent-title {
    color: #ffffff;
  }

  .cookie-consent-description {
    color: #cccccc;
  }

  .cookie-consent-modal-content {
    background-color: #1a1f3a;
  }

  .cookie-consent-modal-header,
  .cookie-consent-modal-footer {
    border-color: #2a3354;
  }

  .cookie-consent-modal-title {
    color: #ffffff;
  }

  .cookie-consent-modal-intro {
    color: #cccccc;
  }

  .cookie-category {
    background-color: #2a3354;
    border-color: #3a4566;
  }

  .cookie-category-name {
    color: #ffffff;
  }

  .cookie-category-description {
    color: #cccccc;
  }

  .cookie-consent-modal-close {
    color: #cccccc;
  }

  .cookie-consent-modal-close:hover,
  .cookie-consent-modal-close:focus {
    background-color: #2a3354;
    color: #ffffff;
  }

  .cookie-btn-customize {
    color: #ffffff;
  }

  .cookie-btn-customize:hover,
  .cookie-btn-customize:focus {
    color: #000000;
  }
}
