/* ===== Overlay & Dialog ===== */
.cookie-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.72); /* slightly darker for contrast behind dialog */
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cookie-overlay.active { opacity: 1; pointer-events: all; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cookie-overlay,
  .cookie-banner,
  .cookie-btn,
  .slider,
  .cookie-settings-icon {
    transition: none !important;
  }
}

/* ===== Banner ===== */
.cookie-banner {
  background: #1a1d24;     /* stays dark */
  color: #e8ecf1;          /* slightly lighter body text for readability */
  width: 100%;
  max-width: 100%;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
  transform: translateY(100%);
  transition: transform 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.cookie-overlay.active .cookie-banner { transform: translateY(0); }

.cookie-content { padding: 22px; font-size: 15px; line-height: 1.55; }
.cookie-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; color: #f5f7fa; }

/* Links: meet 4.5:1 on #1a1d24 */
.cookie-text { margin-bottom: 20px; color: #b6c0cc; }
.cookie-text a {
  color: #7aa2ff;           /* ~7.22:1 vs bg */
  text-decoration: underline; /* visible affordance */
  text-underline-offset: 2px;
}
.cookie-text a:hover,
.cookie-text a:focus-visible { text-decoration-thickness: 2px; }

/* ===== Categories & Toggles ===== */
.cookie-category {
  background: #12151c;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.category-title { font-weight: 600; font-size: 16px; color: #e8ecf1; }
.category-description { font-size: 14px; color: #a7b2bf; line-height: 1.55; }

/* Visually-hidden helper for accessible labels */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute; inset: 0;
  cursor: pointer;
  background-color: #465168;   /* darker track for better contrast against bg */
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  border-radius: 26px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.slider::before {
  position: absolute; content: "";
  height: 20px; width: 20px; left: 3px; top: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s ease;
}

/* Checked state */
.toggle-switch input:checked + .slider { background-color: #3555ff; } /* darker blue for contrast */
.toggle-switch input:checked + .slider::before { transform: translateX(20px); }

/* Disabled state: not just color, also opacity */
.toggle-switch input:disabled + .slider { background-color: #2d3748; cursor: not-allowed; opacity: 0.6; }
.toggle-switch input:disabled + .slider::before { background-color: #c6ced8; }

/* Keyboard focus */
.toggle-switch input:focus-visible + .slider {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px rgba(122,162,255,0.5); /* visible focus ring */
}

/* ===== Buttons (increase color contrast) ===== */
.cookie-buttons {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px;
}
.cookie-btn {
  flex: 1; min-width: 120px; padding: 14px 20px;
  border-radius: 8px; border: none;
  font-weight: 600; font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

/* Primary: ensure >= 4.5:1 with white text */
.btn-accept, .btn-save {
  background: #3555ff; /* ~5.39:1 vs #fff */
  color: #ffffff;
}
.btn-accept:hover, .btn-save:hover { filter: brightness(1.04); }
.btn-accept:focus-visible, .btn-save:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(53,85,255,0.45);
}

.btn-settings, .btn-reject {
  background: #2d3748; /* already good contrast with #e4e7eb */
  color: #e4e7eb;
}
.btn-settings:hover, .btn-reject:hover { filter: brightness(1.05); }
.btn-settings:focus-visible, .btn-reject:focus-visible {
  outline: 2px solid #e4e7eb;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(228,231,235,0.35);
}

/* Full-width save on settings view */
.btn-save { width: 100%; }

/* Mobile stacking */
@media (max-width: 480px) {
  .cookie-buttons { flex-direction: column; }
  .cookie-btn { width: 100%; }
  .cookie-content { padding: 18px; }
}

/* ===== Floating settings icon ===== */
.cookie-settings-icon {
  width: 50px; height: 50px; border-radius: 50%;
  background: #2a2f3a; /* better contrast vs page */
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}
.cookie-settings-icon:hover { transform: scale(1.12); background: #343a46; }
.cookie-settings-icon:focus-visible {
  outline: 2px solid #fff; outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(122,162,255,0.45);
}