/* ────────────────────────────────────────────────────────────────────────────
 * Ethernodes cookie consent — banner + preferences modal
 * Uses CSS variables from styles.css (--eth-* tokens) for theming.
 * ──────────────────────────────────────────────────────────────────────────── */

/* ─── Banner (bottom-right corner) ──────────────────────────────────────── */
.eth-cb {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9000;
  width: min(380px, calc(100vw - 40px));
  padding: 18px 20px;
  background: var(--eth-ink-800, #232423);
  border: 1px solid var(--eth-border, #3A3D3A);
  border-radius: 14px;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,0.7), 0 0 0 1px rgba(147,255,150,0.04);
  font-family: var(--eth-font-sans, system-ui, sans-serif);
  color: var(--eth-fg, #E7EAE7);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.eth-cb.is-visible { opacity: 1; transform: translateY(0); }

.eth-cb__text {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--eth-fg-muted, #A0A6A0);
}
.eth-cb__link {
  color: var(--eth-green-200, #93FF96);
  text-decoration: none;
  border-bottom: 1px solid rgba(147,255,150,0.3);
}
.eth-cb__link:hover { border-color: var(--eth-green-200, #93FF96); }

.eth-cb__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.eth-cb__btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
  font-family: var(--eth-font-mono, ui-monospace, monospace);
  letter-spacing: 0.04em;
}
.eth-cb__btn--ghost {
  background: transparent;
  border-color: var(--eth-border, #3A3D3A);
  color: var(--eth-fg-muted, #A0A6A0);
}
.eth-cb__btn--ghost:hover {
  border-color: var(--eth-green-200, #93FF96);
  color: var(--eth-green-200, #93FF96);
  background: rgba(147,255,150,0.06);
}
.eth-cb__btn--primary {
  background: var(--eth-green-200, #93FF96);
  border-color: var(--eth-green-200, #93FF96);
  color: var(--eth-ink-900, #1E1F1E);
  font-weight: 600;
}
.eth-cb__btn--primary:hover { filter: brightness(1.08); }

/* ─── Preferences modal ────────────────────────────────────────────────── */
.eth-cm {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.eth-cm.is-visible { opacity: 1; }
.eth-cm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,11,10,0.78);
  backdrop-filter: blur(4px);
}
.eth-cm__dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--eth-ink-800, #232423);
  border: 1px solid var(--eth-border, #3A3D3A);
  border-radius: 16px;
  padding: 32px 30px 26px;
  box-shadow: 0 32px 80px -16px rgba(0,0,0,0.8);
  color: var(--eth-fg, #E7EAE7);
  font-family: var(--eth-font-sans, system-ui, sans-serif);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.eth-cm.is-visible .eth-cm__dialog { transform: translateY(0) scale(1); }

.eth-cm__close {
  position: absolute;
  top: 14px; right: 16px;
  background: transparent;
  border: none;
  color: var(--eth-ink-200, #A0A6A0);
  font-size: 28px;
  line-height: 1;
  width: 32px; height: 32px;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.18s, background 0.18s;
}
.eth-cm__close:hover {
  color: var(--eth-green-200, #93FF96);
  background: rgba(147,255,150,0.08);
}
.eth-cm__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
}
.eth-cm__intro {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--eth-fg-muted, #A0A6A0);
}

.eth-cm__cat {
  padding: 16px 0;
  border-top: 1px solid var(--eth-border, #3A3D3A);
}
.eth-cm__cat:last-of-type { border-bottom: 1px solid var(--eth-border, #3A3D3A); margin-bottom: 22px; }

.eth-cm__cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 14px;
}
.eth-cm__cat-head strong { font-size: 15px; }
.eth-cm__cat-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--eth-fg-muted, #A0A6A0);
}
.eth-cm__always {
  font-family: var(--eth-font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--eth-green-200, #93FF96);
  opacity: 0.85;
}

/* iOS-style toggle switch */
.eth-cm__switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.eth-cm__switch input { opacity: 0; width: 0; height: 0; }
.eth-cm__switch span {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--eth-ink-500, #3A3D3A);
  border-radius: 999px;
  transition: background 0.22s;
}
.eth-cm__switch span::before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.22s;
}
.eth-cm__switch input:checked + span { background: var(--eth-green-200, #93FF96); }
.eth-cm__switch input:checked + span::before { transform: translateX(18px); }

.eth-cm__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* ─── Mobile tweaks ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .eth-cb { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 16px; }
  .eth-cb__actions { justify-content: stretch; }
  .eth-cb__btn { flex: 1; text-align: center; }
  .eth-cm__dialog { padding: 28px 20px 22px; }
  .eth-cm__actions { flex-direction: column-reverse; }
  .eth-cm__actions .eth-cb__btn { width: 100%; }
}

/* ─── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .eth-cb, .eth-cm, .eth-cm__dialog, .eth-cm__switch span, .eth-cm__switch span::before {
    transition: none;
  }
}
