.tf-consent-banner,
.tf-consent-dialog {
  --tf-consent-bg: #fff;
  --tf-consent-text: #121110;
  --tf-consent-muted: #58534c;
  --tf-consent-surface: #f6f5f1;
  --tf-consent-border: #d9d5cd;
  --tf-consent-hover: #efeee9;
  --tf-consent-gold: #f9b442;
  --tf-consent-gold-hover: #ffca68;
  --tf-consent-focus: #805500;
  --tf-consent-track: #e5e1d9;
  --tf-consent-track-border: #858076;
  --tf-consent-thumb: #5c5750;
  --tf-consent-gutter: 16px;
  box-sizing: border-box;
  color: var(--tf-consent-text);
  background: var(--tf-consent-bg);
  border: 1px solid var(--tf-consent-border);
  border-radius: 22px;
  padding: 22px;
  font-family: var(--b-font, "Archivo", system-ui, sans-serif);
  color-scheme: light;
  box-shadow: 0 16px 55px rgb(18 17 16 / 20%);
}

html:not([data-tf-theme="light"]) .tf-consent-banner,
html:not([data-tf-theme="light"]) .tf-consent-dialog {
  --tf-consent-bg: #151517;
  --tf-consent-text: #f2f1ee;
  --tf-consent-muted: #bdb9b3;
  --tf-consent-surface: #1d1d20;
  --tf-consent-border: #414146;
  --tf-consent-hover: #2c2c30;
  --tf-consent-focus: #ffca68;
  --tf-consent-track: #333338;
  --tf-consent-track-border: #84848b;
  --tf-consent-thumb: #e0ded8;
  color-scheme: dark;
  box-shadow: 0 16px 55px rgb(0 0 0 / 55%);
}

.tf-consent-banner {
  --tf-consent-left: max(var(--tf-consent-gutter), env(safe-area-inset-left));
  --tf-consent-right: max(var(--tf-consent-gutter), env(safe-area-inset-right));
  --tf-consent-bottom: max(var(--tf-consent-gutter), env(safe-area-inset-bottom));
  position: fixed;
  z-index: 1800;
  width: min(470px, calc(100% - var(--tf-consent-left) - var(--tf-consent-right)));
  left: var(--tf-consent-left);
  bottom: var(--tf-consent-bottom);
  max-height: calc(100dvh - var(--tf-consent-bottom) - var(--tf-consent-gutter));
  overflow: auto;
  overscroll-behavior: contain;
}

.tf-consent-banner[hidden] {
  display: none;
}

.tf-consent-banner h2,
.tf-consent-dialog h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  color: var(--tf-consent-text);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.tf-consent-banner h2::before,
.tf-consent-dialog h2::before {
  content: "";
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #151517 url("/brand/transfeero-mark.svg") center / 22px 22px no-repeat;
}

.tf-consent-banner p,
.tf-consent-dialog p {
  margin: 0 0 20px;
  color: var(--tf-consent-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.tf-consent-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(540px, calc(100% - 2 * var(--tf-consent-gutter)));
  max-height: calc(100dvh - max(var(--tf-consent-gutter), env(safe-area-inset-top)) - max(var(--tf-consent-gutter), env(safe-area-inset-bottom)));
  padding: 26px;
  overflow: auto;
  overscroll-behavior: contain;
}

.tf-consent-dialog h2 {
  margin-inline-end: 48px;
}

.tf-consent-dialog::backdrop {
  background: rgb(11 11 12 / 56%);
  backdrop-filter: blur(3px);
}

.tf-consent-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tf-consent-actions button {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--tf-consent-border);
  border-radius: 11px;
  color: var(--tf-consent-text);
  background: var(--tf-consent-surface);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

.tf-consent-actions .tf-consent-primary {
  border-color: transparent;
  color: #121110;
  background: var(--tf-consent-gold);
}

.tf-consent-actions button:focus-visible,
.tf-consent-dialog input:focus-visible,
.tf-consent-close:focus-visible {
  outline: 2px solid var(--tf-consent-focus);
  outline-offset: 3px;
}

.tf-consent-close {
  position: absolute;
  inset-block-start: 17px;
  inset-inline-end: 17px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--tf-consent-border);
  border-radius: 50%;
  color: var(--tf-consent-text);
  background: var(--tf-consent-surface);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.tf-consent-form fieldset {
  display: grid;
  gap: 6px;
  min-inline-size: 0;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.tf-consent-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px 12px;
  border: 1px solid var(--tf-consent-border);
  border-radius: 11px;
  color: var(--tf-consent-text);
  background: var(--tf-consent-surface);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

.tf-consent-category:has(input:disabled) {
  color: var(--tf-consent-muted);
  cursor: default;
}

.tf-consent-category input {
  appearance: none;
  position: relative;
  grid-column: 2;
  grid-row: 1;
  box-sizing: border-box;
  inline-size: 42px;
  block-size: 25px;
  margin: 0;
  border: 1px solid var(--tf-consent-track-border);
  border-radius: 999px;
  background: var(--tf-consent-track);
  cursor: inherit;
}

.tf-consent-category input::after {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--tf-consent-thumb);
}

.tf-consent-category input:checked {
  border-color: transparent;
  background: var(--tf-consent-gold);
}

.tf-consent-category input:checked::after {
  inset-inline-start: 20px;
  background: #121110;
}

.tf-consent-category input:disabled {
  opacity: 0.65;
}

.tf-consent-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (hover: hover) {
  .tf-consent-actions button:not(.tf-consent-primary):hover,
  .tf-consent-close:hover {
    background: var(--tf-consent-hover);
  }

  .tf-consent-actions .tf-consent-primary:hover {
    background: var(--tf-consent-gold-hover);
  }
}

@media (max-width: 520px) {
  .tf-consent-banner,
  .tf-consent-dialog {
    --tf-consent-gutter: 12px;
    border-radius: 19px;
    padding: 17px;
  }

  .tf-consent-banner p,
  .tf-consent-dialog p {
    margin-bottom: 14px;
  }

  .tf-consent-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tf-consent-banner .tf-consent-actions button:first-child,
  .tf-consent-dialog .tf-consent-primary {
    grid-column: 1 / -1;
  }

  .tf-consent-close {
    inset-block-start: 12px;
    inset-inline-end: 12px;
  }

  .tf-consent-form fieldset {
    margin-bottom: 14px;
  }
}

@media (forced-colors: active) {
  .tf-consent-category input {
    appearance: auto;
    inline-size: 22px;
    block-size: 22px;
  }

  .tf-consent-category input::after {
    display: none;
  }
}
