/* ============================================================================
   RGPD - Styles pour banniere de consentement et modal
   ============================================================================ */

/* Banniere de consentement */
.rgpd-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #011e2b;
  color: white;
  padding: 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.rgpd-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.rgpd-banner-text h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.rgpd-banner-text p {
  margin: 0;
  color: #d1d5db;
  max-width: 600px;
}

.rgpd-policy-link {
  color: #03a9f5 !important;
  text-decoration: underline;
  margin-left: 8px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.rgpd-policy-link:hover {
  color: #0288d1 !important;
  text-decoration: none;
}

.rgpd-banner-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* Boutons RGPD */
.rgpd-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  min-width: 100px;
}

.rgpd-btn:focus {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 1px #03a9f5;
}

.rgpd-btn-primary {
  background: #03a9f5;
  color: white;
  font-weight: 600;
}

.rgpd-btn-primary:hover {
  background: #0288d1;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(3, 169, 245, 0.3);
}

.rgpd-btn-primary:focus {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  background: #0288d1;
}

.rgpd-btn-secondary {
  background: #3a526a;
  color: white;
  font-weight: 600;
}

.rgpd-btn-secondary:hover {
  background: #2c3e50;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(58, 82, 106, 0.3);
}

.rgpd-btn-secondary:focus {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  background: #2c3e50;
}

.rgpd-btn-tertiary {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
  font-weight: 600;
}

.rgpd-btn-tertiary:hover {
  background: #ffffff;
  color: #011e2b;
  border: 2px solid #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.rgpd-btn-tertiary:focus {
  outline: 3px solid #03a9f5;
  outline-offset: 3px;
}

/* Modal RGPD */
.rgpd-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Poppins", sans-serif;
}

.rgpd-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.rgpd-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: rgpd-modal-appear 0.3s ease-out;
  border: 1px solid #e5e7eb;
}

@keyframes rgpd-modal-appear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.rgpd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.rgpd-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #011e2b;
}

.rgpd-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  color: #3a526a;
  transition: all 0.2s ease;
  font-size: 24px;
  line-height: 1;
}

.rgpd-modal-close:hover {
  background: #f3f4f6;
  color: #011e2b;
}

.rgpd-modal-close:focus {
  outline: 3px solid #03a9f5;
  outline-offset: 2px;
  background: #f3f4f6;
}

.rgpd-modal-body {
  padding: 24px;
  max-height: 400px;
  overflow-y: auto;
}

.rgpd-modal-intro {
  margin: 0 0 24px 0;
  color: #3a526a;
  line-height: 1.6;
  font-size: 14px;
  font-weight: 400;
}

/* Categories de cookies */
.rgpd-cookie-category {
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.rgpd-category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.2s ease;
}

.rgpd-category-header:hover {
  background: #f1f5f9;
}

.rgpd-category-info h3 {
  margin: 0 0 2px 0;
  font-size: 15px;
  font-weight: 600;
  color: #011e2b;
}

.rgpd-category-info p {
  margin: 0;
  color: #3a526a;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.rgpd-category-details {
  padding: 0 20px 16px 20px;
  background: #f8fafc;
}

.rgpd-category-details ul {
  margin: 0;
  padding-left: 20px;
  color: #3a526a;
  font-size: 13px;
  font-weight: 400;
}

.rgpd-category-details li {
  margin-bottom: 4px;
  line-height: 1.5;
}

/* ============================================================================
   Toggle Switch — clean, modern design
   ============================================================================ */
.rgpd-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.rgpd-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.rgpd-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #d1d5db;
  transition: background-color 0.3s ease;
  border-radius: 24px;
}

.rgpd-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ON state */
input:checked + .rgpd-slider {
  background: #03a9f5;
}

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

/* Focus state */
input:focus-visible + .rgpd-slider {
  outline: 2px solid #03a9f5;
  outline-offset: 2px;
}

/* Hover state */
.rgpd-switch:hover .rgpd-slider {
  background: #b0b7bf;
}

.rgpd-switch:hover input:checked + .rgpd-slider {
  background: #0288d1;
}

/* Disabled state (essential cookies — always on) */
input:disabled + .rgpd-slider {
  background: #03a9f5;
  opacity: 0.5;
  cursor: not-allowed;
}

input:disabled + .rgpd-slider:before {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.rgpd-switch:hover input:disabled + .rgpd-slider {
  background: #03a9f5;
}

.rgpd-modal-footer {
  padding: 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Bouton de parametres flottant */
.rgpd-settings-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.rgpd-settings-btn:hover {
  opacity: 1 !important;
  transform: scale(1.05);
}

.rgpd-btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #011e2b;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.rgpd-btn-icon:hover {
  background: #03a9f5;
  border-color: #03a9f5;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(3, 169, 245, 0.35);
}

.rgpd-btn-icon:focus {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.rgpd-btn-icon svg {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.rgpd-btn-icon:hover svg {
  transform: rotate(45deg);
}

/* Responsive */
@media (max-width: 768px) {
  .rgpd-banner-content {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .rgpd-banner-actions {
    justify-content: space-between;
  }

  .rgpd-btn {
    flex: 1;
    min-width: auto;
    padding: 12px 8px;
    font-size: 13px;
  }

  .rgpd-modal-content {
    width: 95%;
    margin: 20px;
  }

  .rgpd-modal-header,
  .rgpd-modal-body,
  .rgpd-modal-footer {
    padding: 16px;
  }

  .rgpd-category-header {
    padding: 14px 16px;
  }

  .rgpd-category-details {
    padding: 0 16px 14px 16px;
  }

  .rgpd-modal-footer {
    flex-direction: column;
  }

  .rgpd-settings-btn {
    bottom: 100px;
    right: 15px;
    opacity: 0.6;
  }

  .rgpd-btn-icon {
    width: 36px;
    height: 36px;
  }

  .rgpd-btn-icon svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .rgpd-banner {
    padding: 16px;
  }

  .rgpd-banner-text h3 {
    font-size: 15px;
  }

  .rgpd-banner-text p {
    font-size: 13px;
  }

  .rgpd-btn {
    padding: 10px 6px;
    font-size: 12px;
  }
}

/* Animation d'apparition */
.rgpd-banner.animate-in {
  animation: rgpd-slide-up 0.4s ease-out;
}

@keyframes rgpd-slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Etats hover ameliores */
.rgpd-btn:active {
  transform: translateY(0);
}

.rgpd-modal-close:active {
  transform: scale(0.95);
}

/* ============================================================================
   FORMULAIRE DE CONTACT - Consentement RGPD
   ============================================================================ */

.rgpd-consent-field {
  margin: 20px 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border: none;
}

.rgpd-consent-field > input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.rgpd-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}

.rgpd-consent-checkbox {
  margin: 0;
  min-width: 18px;
  width: 18px;
  height: 18px;
  accent-color: #03a9f5;
  cursor: pointer;
}

.rgpd-consent-text {
  color: #3a526a;
  flex: 1;
}

.rgpd-consent-text a {
  color: #03a9f5;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.rgpd-consent-text a:hover {
  color: #0288d1;
}

.rgpd-consent-text .required {
  color: #dc2626;
  font-weight: bold;
  margin-left: 4px;
}

/* Focus state pour accessibilite */
.rgpd-consent-checkbox:focus {
  outline: 2px solid #03a9f5;
  outline-offset: 2px;
}

/* Erreur de validation */
.rgpd-consent-field.error {
  border: 1px solid #e74c3c;
  background: #fdf2f2;
  border-radius: 4px;
  padding: 12px;
}

.rgpd-consent-field.error .rgpd-consent-text {
  color: #e74c3c;
}

/* Message d'erreur */
.rgpd-consent-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 8px;
  display: none;
}

.rgpd-consent-field.error .rgpd-consent-error {
  display: block;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
  .rgpd-consent-field {
    margin: 16px 0;
    padding: 12px;
  }

  .rgpd-consent-label {
    gap: 10px;
    font-size: 13px;
  }

  .rgpd-consent-checkbox {
    min-width: 16px;
    width: 16px;
    height: 16px;
  }
}
