:root {
  --bl-consent-red: #e33922;
  --bl-consent-red-dark: #bd2c1b;
  --bl-consent-ink: #fff;
  --bl-consent-muted: #b9b9b9;
  --bl-consent-surface: #151515;
  --bl-consent-raised: #202020;
  --bl-consent-border: #3a3a3a;
  --bl-consent-focus: #fff;
  --bl-consent-glass: rgb(22 22 22 / 88%);
  --bl-consent-glass-raised: rgb(255 255 255 / 6%);
  --bl-consent-glass-border: rgb(255 255 255 / 14%);
}

.bl-consent[hidden],
.bl-consent [hidden],
.bl-consent-manage[hidden] {
  display: none !important;
}

html.bl-consent-is-open {
  overflow: hidden;
}

.bl-consent {
  position: fixed;
  z-index: 1000000;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  padding: clamp(12px, 2.5vw, 30px);
  background: rgb(0 0 0 / 78%);
}

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

.bl-consent__panel {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 22px;
  width: min(100%, 920px);
  max-height: min(90vh, 760px);
  overflow-y: auto;
  padding: clamp(24px, 4vw, 42px);
  color: var(--bl-consent-ink);
  background:
    radial-gradient(circle at 92% 0%, rgb(227 57 34 / 14%), transparent 34%),
    var(--bl-consent-glass);
  border: 1px solid var(--bl-consent-glass-border);
  border-radius: 26px;
  box-shadow:
    0 28px 90px rgb(0 0 0 / 65%),
    inset 0 1px 0 rgb(255 255 255 / 7%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  backdrop-filter: blur(22px) saturate(135%);
  font-family: "Raleway", Arial, sans-serif;
}

.bl-consent__panel::after {
  position: absolute;
  z-index: -1;
  right: 18px;
  top: 4px;
  color: rgb(255 255 255 / 3%);
  font-size: clamp(5rem, 14vw, 10rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.08em;
  content: "REC";
  pointer-events: none;
}

.bl-consent__intro {
  display: grid;
  gap: 10px;
}

.bl-consent__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: #ff6b55;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.bl-consent__eyebrow::before {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--bl-consent-red);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgb(227 57 34 / 16%);
  content: "";
}

.bl-consent__panel h2 {
  max-width: 18ch;
  margin: 0;
  color: var(--bl-consent-ink);
  font-size: clamp(1.75rem, 4.4vw, 3rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.bl-consent__panel p {
  max-width: 68ch;
  margin: 0;
  color: var(--bl-consent-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.bl-consent__preferences {
  display: grid;
  gap: 8px;
}

.bl-consent__category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px 16px;
  background: var(--bl-consent-glass-raised);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%);
}

.bl-consent__category > div,
.bl-consent__category > span:first-child {
  display: grid;
  gap: 4px;
}

.bl-consent__category strong {
  color: #fff;
  font-size: 0.91rem;
}

.bl-consent__category span span {
  color: var(--bl-consent-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.bl-consent__status {
  flex: 0 0 auto;
  padding: 5px 7px;
  color: #bdf2c8;
  background: #18311e;
  border: 1px solid #315f3b;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: right;
}

.bl-consent__switch {
  width: 50px;
  height: 28px;
  flex: 0 0 auto;
  margin: 0;
  appearance: none;
  background: #303030;
  border: 1px solid #555;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.bl-consent__switch::before {
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px;
  background: #aaa;
  border-radius: 50%;
  content: "";
  transform: translateX(0);
  transition: transform 160ms ease, background-color 160ms ease;
}

.bl-consent__switch:checked {
  background: var(--bl-consent-red);
  border-color: #ff725e;
}

.bl-consent__switch:checked::before {
  background: #fff;
  transform: translateX(22px);
}

.bl-consent__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.bl-consent__button {
  min-height: 50px;
  padding: 11px 16px;
  color: #fff;
  background: transparent;
  border: 1px solid #5a5a5a;
  border-radius: 14px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.bl-consent__button--primary {
  background: var(--bl-consent-red);
  border-color: var(--bl-consent-red);
}

.bl-consent__button--primary:hover {
  background: var(--bl-consent-red-dark);
  border-color: #ff6b55;
}

.bl-consent__button--secondary {
  grid-column: 1 / -1;
}

.bl-consent__button--secondary:hover {
  background: #292929;
  border-color: #888;
}

.bl-consent__button:hover {
  transform: translateY(-1px);
}

.bl-consent__learn-more {
  justify-self: start;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: #cfcfcf;
  font-size: 0.78rem;
  text-underline-offset: 4px;
}

.bl-consent__switch:focus-visible,
.bl-consent__button:focus-visible,
.bl-consent__learn-more:focus-visible,
.bl-consent-manage:focus-visible {
  outline: 3px solid var(--bl-consent-focus);
  outline-offset: 3px;
}

button.bl-consent-manage {
  position: fixed;
  z-index: 99990;
  left: 10px;
  bottom: 10px;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 12px;
  color: #d6d6d6;
  background: rgb(25 25 25 / 84%);
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%), inset 0 1px 0 rgb(255 255 255 / 5%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  backdrop-filter: blur(14px) saturate(125%);
  font-family: "Raleway", Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 750;
  cursor: pointer;
}

button.bl-consent-manage:hover {
  color: #fff;
  background: #262626;
  border-color: var(--bl-consent-red);
}

@media (min-width: 760px) {
  .bl-consent__panel:has(.bl-consent__preferences:not([hidden])) {
    grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
  }

  .bl-consent__panel:has(.bl-consent__preferences:not([hidden])) .bl-consent__actions,
  .bl-consent__panel:has(.bl-consent__preferences:not([hidden])) .bl-consent__learn-more {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  .bl-consent {
    padding: 0;
  }

  .bl-consent__panel {
    width: 100%;
    max-height: 94vh;
    padding: 25px 17px calc(20px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 26px 26px 0 0;
  }

  .bl-consent__panel h2 {
    font-size: clamp(1.7rem, 9vw, 2.35rem);
  }

  .bl-consent__actions {
    grid-template-columns: 1fr;
  }

  .bl-consent__button--secondary {
    grid-column: auto;
  }

  .bl-consent__category {
    align-items: flex-start;
  }

  button.bl-consent-manage {
    left: 8px;
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .bl-consent__switch,
  .bl-consent__switch::before,
  .bl-consent__button {
    transition: none;
  }
}
