/* ── Cookie consent banner ─────────────────────────────────── */
.consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 300;
  background: var(--bg-raised);
  border-top: 1px solid var(--border-bright);
  box-shadow: 0 -8px 30px rgba(0,0,0,0.35);
  padding: 18px 0;
}

.consent-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.consent-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 640px;
  flex: 1 1 320px;
}
.consent-text a { color: var(--accent-bright); text-decoration: underline; }

.consent-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.consent-actions .btn { padding: 9px 16px; font-size: var(--text-sm); }

@media (max-width: 640px) {
  .consent-inner { padding: 0 16px; }
  .consent-actions { width: 100%; }
  .consent-actions .btn { flex: 1; justify-content: center; }
}

/* ── Cookie preferences panel ─────────────────────────────── */
.consent-overlay {
  position: fixed; inset: 0;
  z-index: 400;
  background: rgba(4, 6, 12, 0.68);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.consent-panel {
  width: 100%; max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.consent-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.consent-panel-head h2 { font-size: var(--text-heading); }

.consent-close {
  background: none; border: none;
  font-size: 22px; line-height: 1;
  color: var(--text-dim); cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.consent-close:hover { color: var(--text); background: var(--surface-2); }

.consent-panel-lede {
  font-size: var(--text-sm); color: var(--text-muted); line-height: 1.55;
  margin-bottom: 22px;
}

.consent-row {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.consent-row:first-of-type { border-top: none; }

.consent-row-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 6px;
}
.consent-row-head strong { font-size: var(--text-body); }

.consent-row p { margin: 0; font-size: var(--text-sm); color: var(--text-muted); line-height: 1.5; }

/* Toggle switch */
.consent-toggle { position: relative; display: inline-flex; flex-shrink: 0; }
.consent-toggle input {
  position: absolute; opacity: 0; width: 40px; height: 22px; margin: 0; cursor: pointer;
}
.consent-toggle input:disabled { cursor: not-allowed; }
.consent-toggle-track {
  width: 40px; height: 22px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border-bright);
  position: relative;
  transition: background .15s ease;
}
.consent-toggle-track::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform .15s ease, background .15s ease;
}
.consent-toggle input:checked + .consent-toggle-track { background: var(--accent-glow); border-color: var(--accent); }
.consent-toggle input:checked + .consent-toggle-track::after { transform: translateX(18px); background: var(--accent-bright); }
.consent-toggle input:disabled + .consent-toggle-track { opacity: 0.6; }

.consent-panel-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.consent-panel-actions .btn { font-size: var(--text-sm); padding: 9px 16px; }

@media (max-width: 480px) {
  .consent-panel-actions { flex-direction: column-reverse; }
  .consent-panel-actions .btn { width: 100%; justify-content: center; }
}
