/* Cookie consent banner + settings dialog. Standalone file — see
   assets/js/cookie-consent.js for the logic. Uses the same CSS custom
   properties (--bg-navy, --border, --text-*, --accent, --radius) defined
   in assets/style.css / each page's own <style> block. */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

.cookie-banner[hidden] { display: none; }

.cookie-banner-card {
  pointer-events: auto;
  width: 100%;
  max-width: 760px;
  background: var(--bg-card, #0f192c);
  border: 1px solid var(--border-strong, rgba(255,255,255,0.14));
  border-radius: var(--radius, 16px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cookie-banner-text {
  font-size: 13.5px;
  color: var(--text-secondary, #9aa7bd);
  margin: 0;
  line-height: 1.55;
}

.cookie-banner-text a { color: var(--accent, #2dd4ec); text-decoration: underline; }

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------- Settings dialog ---------- */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cookie-modal[hidden] { display: none; }

.cookie-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,7,13,0.8);
}

.cookie-modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: min(640px, 90vh);
  overflow-y: auto;
  background: var(--bg-card, #0f192c);
  border: 1px solid var(--border-strong, rgba(255,255,255,0.14));
  border-radius: var(--radius, 16px);
  padding: 32px;
  color: var(--text-primary, #eef2f8);
}

.cookie-modal-card h2 {
  font-size: 20px;
  margin: 0 0 10px;
}

.cookie-modal-intro {
  color: var(--text-secondary, #9aa7bd);
  font-size: 13.5px;
  margin: 0 0 20px;
  line-height: 1.55;
}

.cookie-category {
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
  padding: 16px 0;
}

.cookie-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cookie-category-head strong { font-size: 14.5px; }

.cookie-category-desc {
  color: var(--text-secondary, #9aa7bd);
  font-size: 13px;
  margin: 8px 0 0;
  line-height: 1.5;
}

.cookie-category-provider {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-tertiary, #5c6a82);
}

/* Toggle switch */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}
.cookie-switch input {
  position: absolute;
  z-index: 1;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.cookie-switch-track {
  position: absolute;
  inset: 0;
  background: var(--border-strong, rgba(255,255,255,0.14));
  border-radius: 999px;
  transition: background .2s ease;
  pointer-events: none;
}
.cookie-switch-track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-secondary, #9aa7bd);
  transition: transform .2s ease, background .2s ease;
}
.cookie-switch input:checked + .cookie-switch-track {
  background: rgba(45,212,236,0.35);
}
.cookie-switch input:checked + .cookie-switch-track::before {
  transform: translateX(18px);
  background: var(--accent, #2dd4ec);
}
.cookie-switch input:disabled + .cookie-switch-track { opacity: 0.6; cursor: not-allowed; }
.cookie-switch input:focus-visible + .cookie-switch-track { outline: 2px solid var(--accent, #2dd4ec); outline-offset: 2px; }

.cookie-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.cookie-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: 0;
  color: var(--text-secondary, #9aa7bd);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.cookie-modal-close:hover { color: var(--text-primary, #eef2f8); }

@media (max-width: 640px) {
  .cookie-banner-actions { justify-content: stretch; }
  .cookie-banner-actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; }
}
