/* Cookie consent banner & preferences — uses :root from main site */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0));
  background: rgba(26, 26, 46, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(124, 58, 237, 0.28);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  display: none;
  font-family: 'DM Sans', sans-serif;
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.cookie-banner-text {
  flex: 1 1 280px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.55;
}

.cookie-banner-text strong {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.cookie-banner-text a {
  color: var(--accent2);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(168, 85, 247, 0.35);
}

.cookie-banner-text a:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.cookie-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.cookie-btn-primary {
  background: var(--accent);
  color: #fff;
}

.cookie-btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}

.cookie-btn-outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.cookie-btn-outline:hover {
  border-color: var(--accent2);
  color: #fff;
}

.cookie-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.cookie-btn-ghost:hover {
  background: rgba(124, 58, 237, 0.35);
  color: #fff;
}

/* Preferences overlay */
.cookie-prefs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3100;
  background: rgba(10, 10, 20, 0.55);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.cookie-prefs-overlay.is-open {
  display: flex;
}

.cookie-prefs-overlay.is-visible {
  opacity: 1;
}

.cookie-prefs-box {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: min(90vh, 640px);
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 80px rgba(15, 17, 25, 0.2);
  transform: scale(0.96) translateY(12px);
  transition: transform 0.28s ease;
}

.cookie-prefs-overlay.is-visible .cookie-prefs-box {
  transform: scale(1) translateY(0);
}

.cookie-prefs-scroll {
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: 2rem 2rem 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.4) rgba(124, 58, 237, 0.08);
}

.cookie-prefs-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--pill);
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.cookie-prefs-close:hover {
  background: var(--accent);
  color: #fff;
}

.cookie-prefs-box h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dark);
  margin: 0 2.5rem 0.5rem 0;
  letter-spacing: -0.5px;
}

.cookie-prefs-intro {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.cookie-prefs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cookie-prefs-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
}

.cookie-prefs-list strong {
  display: block;
  font-size: 14px;
  color: var(--dark);
  margin-bottom: 0.2rem;
}

.cookie-prefs-list span:not(.cookie-slider) {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.cookie-toggle-locked {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  white-space: nowrap;
}

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

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

.cookie-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 26px;
  transition: background 0.2s;
}

.cookie-slider::before {
  position: absolute;
  content: '';
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s;
}

.cookie-switch input:checked + .cookie-slider {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

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

.cookie-switch input:focus-visible + .cookie-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cookie-prefs-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.cookie-prefs-footer .cookie-btn-primary {
  background: var(--dark);
  color: #fff;
}

.cookie-prefs-footer .cookie-btn-primary:hover {
  background: var(--accent);
}

.cookie-prefs-footer .cookie-btn-outline {
  border: 1px solid rgba(26, 26, 46, 0.2);
  color: var(--dark);
  background: #fff;
}

.cookie-prefs-footer .cookie-btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 640px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner-actions {
    justify-content: stretch;
  }

  .cookie-banner-actions .cookie-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
