/* Cookie consent UI (consent.js). Tokens mirror portal/client/public/sandbox/site3/styles.css.
   Every rule is scoped under .cc because this loads on both marketing stacks, whose global
   element styles (h2, p, ul, button, code) differ. */

.cc {
  --cc-purple: #6663fd;
  /* Brand purple is 4.4:1 under white text; buttons use the darker accent to clear WCAG AA. */
  --cc-purple-strong: #5451e0;
  --cc-purple-08: rgba(102, 99, 253, 0.08);
  --cc-text: #0a0a0a;
  --cc-text-2: #52525e;
  --cc-text-3: #6b7280;
  --cc-border: #e5e7eb;
  --cc-ghost-border: #d6d6df;
  --cc-surface: #f8f8fa;
  --cc-shadow: 0 2px 6px rgba(16, 17, 20, 0.06), 0 18px 48px -16px rgba(16, 17, 20, 0.22);
  font-family:
    "Aspekta",
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--cc-text);
  -webkit-font-smoothing: antialiased;
}
.cc *,
.cc *::before,
.cc *::after {
  box-sizing: border-box;
}
:where(.cc) :where(h2, p, ul) {
  margin: 0;
  letter-spacing: normal;
  text-transform: none;
}
:where(.cc) button {
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
}
.cc a {
  color: var(--cc-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cc [hidden] {
  display: none !important;
}

/* First layer: a corner card that never covers the hero CTAs or blocks scrolling. */
.cc-card {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 2147483000;
  width: 420px;
  background: #fff;
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  box-shadow: var(--cc-shadow);
  padding: 20px 20px 18px;
}
.cc-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.cc-card__title svg {
  color: var(--cc-purple);
  flex: none;
}
.cc-card__body {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cc-text-2);
}
.cc-card__body a {
  color: var(--cc-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cc-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cc-actions .cc-btn {
  flex: 1;
}
.cc-actions--center {
  justify-content: center;
  margin-top: 4px;
}
.cc-actions--center .cc-btn {
  flex: none;
}

/* Reject and Accept share one style on purpose: the EDPB treats a more
   prominent Accept as a dark pattern. */
.cc-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 4px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    filter 0.12s,
    background 0.12s,
    border-color 0.12s;
}
.cc-btn--choice {
  background: var(--cc-purple-strong);
  border: 1px solid var(--cc-purple-strong);
  color: #fff;
}
.cc-btn--choice:hover {
  filter: brightness(1.08);
}
.cc-btn--ghost {
  background: #fff;
  border: 1px solid var(--cc-ghost-border);
  color: var(--cc-text);
}
.cc-btn--ghost:hover {
  background: #f4f4f7;
  border-color: #b9b9c6;
}
.cc-btn--link {
  background: none;
  border: 0;
  padding: 8px 2px;
  color: var(--cc-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 0;
}
.cc-btn:focus-visible,
.cc-switch input:focus-visible + span,
.cc-row__more:focus-visible {
  outline: 2px solid var(--cc-purple);
  outline-offset: 2px;
}

/* US notice: lighter, one line on desktop. */
.cc-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(880px, calc(100vw - 40px));
  padding: 12px 12px 12px 18px;
  background: #fff;
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  box-shadow: var(--cc-shadow);
}
.cc-bar__text {
  flex: 1;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--cc-text-2);
}
.cc-bar__text a {
  color: var(--cc-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cc-bar .cc-actions {
  flex: none;
}
.cc-bar--notice .cc-bar__text {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #3b3a8f;
}
.cc-bar--notice .cc-bar__text svg {
  flex: none;
  margin-top: 2px;
}

/* Preferences: a native <dialog> (focus trap, Escape and inert page for free), centred on
   desktop and a bottom sheet on phones. */
.cc-dialog {
  width: min(560px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  color: var(--cc-text);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--cc-shadow);
  overflow: hidden;
}
.cc-dialog[open] {
  display: flex;
  flex-direction: column;
}
.cc-dialog:focus {
  outline: none;
}
.cc-dialog::backdrop {
  background: rgba(10, 10, 20, 0.36);
}
.cc-dialog__head {
  padding: 22px 24px 6px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cc-dialog__head h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cc-dialog__head p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cc-text-2);
}
.cc-dialog__head p a {
  color: var(--cc-text);
}
.cc-close {
  margin-left: auto;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 0;
  background: none;
  color: var(--cc-text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.cc-close:hover {
  background: #f4f4f7;
}
.cc-dialog__body {
  padding: 10px 24px 8px;
  overflow: auto;
}
.cc-dialog__foot {
  display: flex;
  gap: 8px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--cc-border);
  background: #fff;
}
.cc-dialog__foot .cc-btn {
  flex: 1;
}

.cc-gpc {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 6px 0 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--cc-purple-08);
  font-size: 13px;
  line-height: 1.5;
  color: #3b3a8f;
}
.cc-gpc svg {
  flex: none;
  margin-top: 2px;
}

.cc-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--cc-border);
}
.cc-row:last-child {
  border-bottom: 0;
}
.cc-row__top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cc-row__name {
  font-size: 14.5px;
  font-weight: 600;
}
.cc-row__desc {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cc-text-2);
}
.cc-row__always {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--cc-text-3);
}
.cc-row__more {
  margin-top: 6px;
  padding: 2px 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--cc-purple);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cc-row__more svg {
  transition: transform 0.15s;
}
.cc-row[data-open] .cc-row__more svg {
  transform: rotate(90deg);
}
.cc-vendors {
  display: none;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--cc-border);
  border-radius: 8px;
}
.cc-row[data-open] .cc-vendors {
  display: block;
}
.cc-vendors li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  border-bottom: 1px solid var(--cc-border);
}
.cc-vendors li:last-child {
  border-bottom: 0;
}
.cc-vendors b {
  font-weight: 600;
}
.cc-vendors span {
  color: var(--cc-text-2);
}
.cc-vendors__cookies {
  display: block;
  margin-top: 3px;
}
.cc-vendors code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--cc-text);
  background: none;
  padding: 0;
}

.cc-switch {
  margin-left: auto;
  position: relative;
  display: inline-flex;
  flex: none;
  cursor: pointer;
}
.cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.cc-switch span {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #d4d4dc;
  position: relative;
  transition: background 0.15s;
}
.cc-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.cc-switch input:checked + span {
  background: var(--cc-purple);
}
.cc-switch input:checked + span::after {
  transform: translateX(16px);
}
.cc-switch input:disabled + span {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Phones: full-width sheet; buttons stack so each is a 48px target. */
@media (max-width: 600px) {
  .cc-card {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    border-radius: 16px 16px 0 0;
    border-width: 1px 0 0;
    padding: 18px 20px calc(16px + env(safe-area-inset-bottom));
  }
  .cc-card__body {
    font-size: 15px;
  }
  .cc-actions {
    flex-wrap: wrap;
  }
  .cc-actions .cc-btn {
    flex: 1 1 calc(50% - 4px);
    min-height: 48px;
    font-size: 15px;
  }
  .cc-actions .cc-btn--link {
    flex-basis: 100%;
    min-height: 40px;
  }
  .cc-bar {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border-radius: 16px 16px 0 0;
    border-width: 1px 0 0;
    padding: 16px 20px calc(14px + env(safe-area-inset-bottom));
  }
  .cc-bar__text {
    font-size: 15px;
  }
  .cc-dialog {
    width: 100%;
    max-height: 88svh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }
  .cc-dialog__head {
    padding: 20px 20px 4px;
  }
  .cc-dialog__body {
    padding: 8px 20px;
  }
  .cc-dialog__foot {
    flex-wrap: wrap;
    padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  }
  .cc-dialog__foot .cc-btn {
    flex: 1 1 calc(50% - 4px);
    min-height: 48px;
    font-size: 15px;
  }
  .cc-dialog__foot .cc-btn--save {
    flex-basis: 100%;
  }
  .cc-vendors li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cc-card,
  .cc-bar {
    animation: cc-rise 0.28s ease-out both;
  }
  @keyframes cc-rise {
    from {
      opacity: 0;
      translate: 0 12px;
    }
  }
}
