/* Cookie Banner Styles */
#cn-consent {
  position: fixed;
  inset: auto 16px 16px auto;
  z-index: 9999;
  display: grid;
  gap: 10px;
  max-width: 540px;
  color: #fff;
  font-family: "Turret Road", system-ui, -apple-system, Inter, Segoe UI, Roboto, Arial;
}

#cn-consent[hidden] {
  display: none !important;
}

#cn-consent a {
  text-decoration: none;
  color: rgba(96, 165, 250, 0.9);
  transition: color 0.3s ease;
}

#cn-consent a:hover {
  color: rgba(96, 165, 250, 1);
}

#cn-consent * {
  box-sizing: border-box;
}

/* Toast (main banner) */
.cn-toast {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(
    180deg,
    rgba(31, 41, 55, 0.95),
    rgba(31, 41, 55, 0.85)
  );
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: saturate(130%) blur(10px);
}

.cn-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
}

.cn-content {
  flex: 1 1 auto;
  min-width: 0;
}

.cn-title {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: #ffffff;
}

.cn-description {
  opacity: 0.95;
  margin-top: 4px;
  line-height: 1.5;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.cn-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
  margin-top: 12px;
}

.cn-button {
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Turret Road", system-ui, sans-serif;
}

.cn-button-reject {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.cn-button-reject:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.cn-button-customize {
  background: transparent;
  border-color: rgba(96, 165, 250, 0.4);
  color: rgba(96, 165, 250, 0.9);
}

.cn-button-customize:hover {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

.cn-button-accept {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  color: #fff;
  border: none;
}

.cn-button-accept:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
}

/* Panel (preferences) */
.cn-panel {
  display: none;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(
    180deg,
    rgba(31, 41, 55, 0.95),
    rgba(31, 41, 55, 0.85)
  );
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: saturate(130%) blur(10px);
}

.cn-panel.active {
  display: block;
}

.cn-panel-title {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: #ffffff;
}

.cn-preference {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.2);
  margin-bottom: 10px;
}

.cn-preference:last-of-type {
  margin-bottom: 0;
}

.cn-preference h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.cn-preference p {
  margin: 4px 0 0;
  opacity: 0.85;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.cn-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: all 0.3s ease;
}

.cn-toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  z-index: 2;
}

.cn-toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cn-toggle input:checked + .cn-toggle-slider {
  left: 26px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.cn-toggle input:checked ~ .cn-toggle-bg {
  background: rgba(96, 165, 250, 0.3);
  border-color: rgba(96, 165, 250, 0.5);
}

.cn-toggle-bg {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  transition: all 0.3s ease;
}

.cn-toggle input:disabled + .cn-toggle-slider {
  background: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
}

.cn-panel-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.cn-button-cancel {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Turret Road", system-ui, sans-serif;
}

.cn-button-cancel:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.cn-button-save {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Turret Road", system-ui, sans-serif;
}

.cn-button-save:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
}

/* Responsive */
@media (max-width: 640px) {
  #cn-consent {
    inset: auto 10px 10px 10px;
    max-width: 100%;
  }
  
  .cn-buttons {
    width: 100%;
    justify-content: flex-end;
  }
  
  .cn-button {
    flex: 1;
    min-width: 0;
  }
  
  .cn-description {
    font-size: 0.9rem;
  }
  
  .cn-toast {
    flex-direction: column;
    gap: 12px;
  }
  
  .cn-buttons {
    margin-left: 0;
    width: 100%;
  }
}

