/*!
 * consent.css — styles for consent.js
 *
 * Everything is themed through the --cc-* custom properties below, each with a
 * fallback, so the dialog looks deliberate on a site that sets nothing and
 * matches the house style on a site that sets them. Override them on :root:
 *
 *   :root {
 *     --cc-accent: #C0552F;
 *     --cc-surface: #FFFCF8;
 *     --cc-radius: 18px;
 *   }
 *
 * A site with its own design tokens can point these straight at them:
 *
 *   :root { --cc-accent: var(--terra); --cc-surface: var(--paper-2); }
 */

:root {
  --cc-surface: #ffffff;
  --cc-surface-2: #f6f6f4;
  --cc-ink: #1b1b19;
  --cc-ink-2: #3c3a37;
  --cc-muted: #6d6a65;
  --cc-line: #e4e1dc;
  --cc-accent: #1f6feb;
  --cc-accent-hover: #1a5fd0;
  --cc-accent-ink: #ffffff;
  --cc-on-surface: #2f7d32;
  --cc-scrim: rgba(20, 18, 16, .55);
  --cc-radius: 16px;
  --cc-radius-sm: 12px;
  --cc-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cc-heading-font: var(--cc-font);
  --cc-shadow: 0 28px 60px -28px rgba(20, 18, 16, .55);
  --cc-z: 2147483000;
}

/* The dialog follows the viewer's theme unless the page pins one with
   [data-theme]. Define light on :root, swap only what changes for dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --cc-surface: #1c1a17;
    --cc-surface-2: #141210;
    --cc-ink: #f2efe9;
    --cc-ink-2: #d7d2ca;
    --cc-muted: #a09a91;
    --cc-line: rgba(255, 255, 255, .12);
    --cc-accent: #6ea8fe;
    --cc-accent-hover: #8bbaff;
    --cc-accent-ink: #10131a;
    --cc-on-surface: #7cc47f;
    --cc-scrim: rgba(0, 0, 0, .66);
    --cc-shadow: 0 28px 60px -28px rgba(0, 0, 0, .8);
  }
}

:root[data-theme='dark'] {
  --cc-surface: #1c1a17;
  --cc-surface-2: #141210;
  --cc-ink: #f2efe9;
  --cc-ink-2: #d7d2ca;
  --cc-muted: #a09a91;
  --cc-line: rgba(255, 255, 255, .12);
  --cc-accent: #6ea8fe;
  --cc-accent-hover: #8bbaff;
  --cc-accent-ink: #10131a;
  --cc-on-surface: #7cc47f;
  --cc-scrim: rgba(0, 0, 0, .66);
  --cc-shadow: 0 28px 60px -28px rgba(0, 0, 0, .8);
}

/* ------------------------------------------------------------------- reset */

/* The dialog is injected into someone else's page, so a host rule like
   `h2 { text-transform: uppercase }` would otherwise redecorate it. These
   resets are wrapped in :where(), which contributes no specificity, so every
   component rule below still wins without needing !important. */
.cc :where(h2, h3, p, ul, ol, li, dl, dt, dd, button, a, small, span, label, summary, details, input, svg) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: start;
  text-transform: none;
  text-decoration: none;
  text-shadow: none;
  letter-spacing: normal;
  font-style: normal;
  list-style: none;
  float: none;
  min-width: 0;
  max-width: none;
  width: auto;
  height: auto;
  box-shadow: none;
  transform: none;
}

.cc, .cc *, .cc *::before, .cc *::after { box-sizing: border-box; }

/* ---------------------------------------------------------------- container */

.cc {
  position: fixed;
  inset: 0;
  z-index: var(--cc-z);
  display: grid;
  place-items: end center;
  padding: 16px;
  font-family: var(--cc-font);
  line-height: 1.5;
}

@media (min-width: 700px) {
  .cc { place-items: center; }
}

.cc[hidden] { display: none; }

.cc__scrim {
  position: absolute;
  inset: 0;
  background: var(--cc-scrim);
  backdrop-filter: blur(2px);
}

.cc__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  overflow: hidden;
  animation: cc-in 260ms cubic-bezier(.16, 1, .3, 1) both;
}

.cc__dialog[hidden] { display: none; }

/* the dialog takes focus on open; that is a programmatic move, not a ring */
.cc__dialog:focus { outline: none; }

@keyframes cc-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cc__dialog { animation: none; }
}

/* --------------------------------------------------------------------- head */

.cc__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--cc-line);
  background: var(--cc-surface-2);
}

.cc__head p {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--cc-muted);
}

.cc__back {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cc-ink-2);
  cursor: pointer;
  transition: background 200ms ease;
}

.cc__back:hover { background: var(--cc-surface); }
.cc__back svg { width: 18px; height: 18px; }
[dir='rtl'] .cc__back svg { transform: scaleX(-1); }

/* --------------------------------------------------------------------- body */

/* the scrolling middle, so the buttons stay reachable on a phone */
.cc__body {
  padding: 24px 24px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cc__title {
  display: block;
  margin: 0 0 16px;
  font-family: var(--cc-heading-font);
  font-size: clamp(19px, 3.4vw, 23px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--cc-ink);
}

.cc__lede {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--cc-muted);
}

.cc__stacks {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.cc__stacks li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--cc-ink-2);
}

.cc__stack-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cc-accent) 14%, transparent);
  color: var(--cc-accent);
}

.cc__stack-icon svg { width: 17px; height: 17px; }

.cc__faq {
  border-top: 1px solid var(--cc-line);
  border-bottom: 1px solid var(--cc-line);
  padding: 4px 0;
  margin-bottom: 16px;
}

.cc__faq summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--cc-ink-2);
}

.cc__faq summary::-webkit-details-marker { display: none; }

.cc__faq summary::after {
  content: '';
  float: inline-end;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-right: 2px solid var(--cc-muted);
  border-bottom: 2px solid var(--cc-muted);
  transform: rotate(45deg);
  transition: transform 200ms ease;
}

.cc__faq[open] summary::after { transform: rotate(-135deg); margin-top: 9px; }

.cc__faq dl { margin: 0 0 12px; font-size: 14px; }
.cc__faq dt { font-weight: 600; color: var(--cc-ink-2); margin-top: 12px; }
.cc__faq dd { margin: 4px 0 0; color: var(--cc-muted); line-height: 1.55; }

.cc__fine {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cc-muted);
}

.cc__fine a { color: var(--cc-accent); text-decoration: underline; text-underline-offset: 2px; }

/* -------------------------------------------------------------- preferences */

.cc__prefs {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.cc__pref {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius-sm);
  background: var(--cc-surface-2);
}

@media (min-width: 520px) {
  .cc__pref {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.cc__pref-text h3 {
  margin: 0 0 4px;
  font-family: var(--cc-font);
  font-size: 15px;
  font-weight: 600;
  color: var(--cc-ink);
}

.cc__pref-text p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cc-muted);
}

.cc__switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.cc__switch.is-locked { cursor: default; }

.cc__switch-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--cc-muted);
}

/* the real checkbox stays in the page for keyboard and screen readers */
.cc__switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cc__track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--cc-line);
  border: 1px solid transparent;
  transition: background 200ms ease;
}

.cc__thumb {
  position: absolute;
  inset-inline-start: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cc-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform 200ms ease;
}

.cc__switch input:checked ~ .cc__track { background: var(--cc-on-surface); }
.cc__switch input:checked ~ .cc__track .cc__thumb { transform: translateX(18px); }
[dir='rtl'] .cc__switch input:checked ~ .cc__track .cc__thumb { transform: translateX(-18px); }
.cc__switch input:disabled ~ .cc__track { opacity: .55; }

.cc__switch input:focus-visible ~ .cc__track {
  outline: 2px solid var(--cc-accent);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ actions */

.cc__actions {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--cc-line);
  background: var(--cc-surface);
}

.cc__actions-row {
  display: grid;
  gap: 8px;
}

@media (min-width: 520px) {
  .cc__actions-row { grid-template-columns: 1fr 1fr; }
}

.cc__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 6px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}

.cc__btn small {
  font-size: 11px;
  font-weight: 400;
  opacity: .75;
}

.cc__btn:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

.cc__btn--primary {
  background: var(--cc-accent);
  color: var(--cc-accent-ink);
}

.cc__btn--primary:hover { background: var(--cc-accent-hover); }

.cc__btn--outline {
  background: var(--cc-surface);
  border-color: var(--cc-line);
  color: var(--cc-ink-2);
}

.cc__btn--outline:hover { border-color: var(--cc-accent); color: var(--cc-accent); }

.cc__btn--quiet {
  background: transparent;
  color: var(--cc-muted);
  font-weight: 500;
  min-height: 40px;
}

.cc__btn--quiet:hover { color: var(--cc-ink); }

.cc__manage {
  margin-top: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------- site theme ----- */

:root {
  --cc-surface: var(--surface);
  --cc-surface-2: var(--surface-2);
  --cc-ink: var(--text);
  --cc-ink-2: var(--text);
  --cc-muted: var(--text-muted);
  --cc-line: var(--border);
  --cc-accent: var(--accent);
  --cc-accent-hover: var(--accent-hover);
  --cc-accent-ink: var(--on-accent);
  --cc-on-surface: var(--accent);
  --cc-radius: var(--r-lg);
  --cc-radius-sm: var(--r-md);
  --cc-font: var(--font-ui);
  --cc-heading-font: var(--font-ui);
  --cc-shadow: 0 24px 64px -28px rgba(15, 30, 28, .65);
}
