/* Bandeau et modale de consentement cookies — version autonome (sans
   dépendance aux variables CSS du site public), utilisée par les rapports
   agent (templates/agency/report.html) et tout autre contexte minimal. */

.cookie-banner[style*="display: none"] { display: none !important; }

.cookie-consent-given .cookie-banner { display: none !important; }

.cookie-banner {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: #ffffff !important;
  z-index: 9999 !important;
  padding: 18px 20px !important;
  border-top: 3px solid #00b894 !important;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.12) !important;
  animation: cc-slideUp 0.4s ease-out !important;
  display: block !important;
  opacity: 1 !important;
}

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

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

.cookie-banner-text h3 {
  margin: 0 0 6px 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
}

.cookie-banner-text p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.cookie-banner-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.cookie-btn i { font-size: 13px; }

.cookie-btn-primary { background: #00b894; color: #fff; }
.cookie-btn-primary:hover { background: #00a383; }

.cookie-btn-secondary {
  background: #fff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}
.cookie-btn-secondary:hover { border-color: #00b894; color: #00b894; }

.cookie-btn-tertiary {
  background: transparent;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.cookie-btn-tertiary:hover { background: #f8fafc; border-color: #94a3b8; }

/* Modale */
.cookie-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cookie-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  animation: cc-fadeIn 0.25s ease-out;
}

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

.cookie-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: cc-modalSlideUp 0.3s ease-out;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
}

@keyframes cc-modalSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.cookie-modal-header {
  padding: 20px 26px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-modal-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
}

.cookie-modal-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.cookie-modal-close:hover { background: #f1f5f9; color: #0f172a; }

.cookie-modal-body {
  padding: 24px 26px;
  overflow-y: auto;
  flex: 1;
}

.cookie-modal-intro {
  color: #475569;
  margin: 0 0 20px;
  line-height: 1.55;
  font-size: 14px;
}

.cookie-category {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.cookie-category:hover { border-color: #00b894; }

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

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

.cookie-category-title i {
  font-size: 18px;
  color: #00b894;
}

.cookie-category-title h3 {
  margin: 0;
  font-size: 15px;
  color: #0f172a;
}

.cookie-badge {
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cookie-badge-required {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.cookie-badge-optional {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.cookie-category-description {
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

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

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

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

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}

input:checked + .cookie-slider { background-color: #00b894; }
input:checked + .cookie-slider:before { transform: translateX(20px); }
input:disabled + .cookie-slider { opacity: 0.5; cursor: not-allowed; }

.cookie-modal-footer-info {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.cookie-modal-footer-info p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.cookie-modal-footer-info a {
  color: #00b894;
  text-decoration: none;
  font-weight: 500;
}
.cookie-modal-footer-info a:hover { text-decoration: underline; }

.cookie-modal-footer {
  padding: 16px 26px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 768px) {
  .cookie-banner-content { flex-direction: column; gap: 16px; align-items: stretch; }
  .cookie-banner-buttons { width: 100%; flex-direction: column; }
  .cookie-btn { width: 100%; justify-content: center; }
  .cookie-modal { padding: 0; align-items: flex-end; }
  .cookie-modal-content { margin: 0; max-height: 92svh; border-radius: 12px 12px 0 0; }
  .cookie-modal-header, .cookie-modal-body, .cookie-modal-footer { padding: 14px 18px; }
  .cookie-modal-footer { flex-direction: column-reverse; }
  .cookie-category-title { flex-wrap: wrap; }
}
