/* ── Cookie consent (GDPR) ────────────────────────────────────────────────────
   Banner + preferences dialog are injected by consent.js on every public page.
   Markup stays hidden until JS toggles [data-open], so no flash before hydration.
   Uses theme tokens from brand.css plus --shadow/--radius/--ease (defined by the
   host page's stylesheet — landing.css or waitlist.css). */
.cc-banner, .cc-modal { display: none; }
.cc-banner[data-open], .cc-modal[data-open] { display: block; }

/* Bottom-anchored consent card — non-blocking, so visitors can still read/scroll. */
.cc-banner {
  position: fixed; z-index: 90; left: 50%; bottom: 1rem; transform: translateX(-50%);
  width: min(440px, calc(100% - 1.5rem));
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 0.95rem 1.05rem;
  animation: ccSlideUp 0.5s var(--ease);
}
@keyframes ccSlideUp { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.cc-banner h2 { font-size: 0.92rem; font-weight: 800; margin: 0 0 0.25rem; letter-spacing: -0.01em; }
.cc-banner p { color: var(--muted); font-size: 0.78rem; line-height: 1.5; margin: 0 0 0.75rem; }
.cc-banner a { color: var(--primary); font-weight: 600; text-decoration: none; }
.cc-banner a:hover { text-decoration: underline; }
.cc-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.cc-actions .cc-btn { flex: 1 1 auto; }

/* Buttons — Accept / Reject share equal prominence (ePrivacy requirement). */
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.5rem 0.9rem; border-radius: 9px; font: inherit; font-weight: 700; font-size: 0.8rem;
  cursor: pointer; border: 1px solid transparent; text-decoration: none; white-space: nowrap;
  transition: transform 0.18s var(--ease), filter 0.18s, border-color 0.18s, background 0.18s;
}
.cc-btn:hover { transform: translateY(-1px); }
.cc-btn-accept { background: var(--primary); color: #fff; box-shadow: 0 10px 20px -12px var(--primary); }
.cc-btn-accept:hover { filter: brightness(1.08); }
.cc-btn-reject { background: color-mix(in srgb, var(--fg) 8%, var(--surface)); color: var(--fg); border-color: var(--border); }
.cc-btn-reject:hover { border-color: var(--primary); }
.cc-btn-manage { background: none; color: var(--muted); font-weight: 600; padding: 0.5rem 0.55rem; font-size: 0.76rem; flex: 1 1 100%; order: 3; }
.cc-btn-manage:hover { color: var(--fg); transform: none; text-decoration: underline; }
.cc-btn-save { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.cc-btn-save:hover { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }

/* Preferences dialog */
.cc-modal { position: fixed; inset: 0; z-index: 100; }
.cc-modal-backdrop { position: absolute; inset: 0; background: rgba(20, 24, 45, 0.55); backdrop-filter: blur(3px); }
.cc-modal-card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 1.5rem)); max-height: min(88vh, 700px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.35rem;
  animation: ccPop 0.35s var(--ease);
}
@keyframes ccPop { from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.cc-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.35rem; }
.cc-modal-head h2 { font-size: 1.08rem; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.cc-close { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1.35rem; line-height: 1; padding: 0.15rem; border-radius: 8px; }
.cc-close:hover { color: var(--fg); }
.cc-modal-intro { color: var(--muted); font-size: 0.82rem; line-height: 1.55; margin: 0 0 1rem; }
.cc-modal-intro a { color: var(--primary); font-weight: 600; }

.cc-cat { border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 0.9rem; margin-bottom: 0.6rem; }
.cc-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cc-cat-head h3 { margin: 0; font-size: 0.9rem; font-weight: 700; }
.cc-cat p { color: var(--muted); font-size: 0.78rem; line-height: 1.5; margin: 0.35rem 0 0; }

/* Accessible toggle switch (real checkbox underneath) */
.cc-switch { position: relative; display: inline-flex; flex: none; width: 42px; height: 24px; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-track { position: absolute; inset: 0; border-radius: 999px; background: color-mix(in srgb, var(--fg) 22%, var(--surface)); transition: background 0.2s var(--ease); }
.cc-track::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform 0.22s var(--ease); }
.cc-switch input:checked + .cc-track { background: var(--primary); }
.cc-switch input:checked + .cc-track::before { transform: translateX(18px); }
.cc-switch input:focus-visible + .cc-track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch input:disabled + .cc-track { opacity: 0.65; }
.cc-cat-locked { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); }

.cc-modal-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.1rem; }
.cc-modal-actions .cc-btn { flex: 1 1 auto; }

/* Footer "Cookie settings" trigger reuses footer-col link styling. */
.cc-settings-link { cursor: pointer; }

@media (max-width: 560px) {
  .cc-banner { bottom: 0; left: 0; right: 0; transform: none; width: 100%; border-radius: 16px 16px 0 0; }
  @keyframes ccSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
  .cc-actions .cc-btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-modal-card { animation: none; }
  .cc-btn:hover { transform: none; }
  .cc-track::before, .cc-switch input:checked + .cc-track { transition: none; }
}
