.fch-consent-banner,
.fch-consent-settings {
  box-sizing: border-box;
  color: #26352d;
  font-family: inherit;
  line-height: 1.5;
}

.fch-consent-banner *,
.fch-consent-settings * {
  box-sizing: border-box;
}

.fch-consent-banner[hidden],
.fch-consent-settings[hidden] {
  display: none;
}

/* Consent banner */

.fch-consent-banner {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 10000;
  width: auto;
  max-width: 900px;
  margin-inline: auto;
  padding: 1.75rem;
  background: #ffffff;
  border: 1px solid #dfe8e2;
  border-radius: 18px;
  box-shadow:
    0 20px 50px rgba(24, 48, 34, 0.16),
    0 4px 14px rgba(24, 48, 34, 0.08);
}

.fch-consent-banner__content {
  display: grid;
  gap: 1rem;
}

.fch-consent-banner__title,
.fch-consent-settings__title {
  margin: 0;
  color: #183326;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.fch-consent-banner__description,
.fch-consent-settings__description,
.fch-consent-category__description {
  margin: 0;
  color: #526158;
}

.fch-consent-banner__description {
  max-width: 70ch;
  font-size: 0.975rem;
}

.fch-consent-banner__actions,
.fch-consent-settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */

.fch-consent-button,
.fch-consent-settings__close {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.fch-consent-button {
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  color: #26352d;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.2;
  background: #ffffff;
  border: 1px solid #bdcbc2;
  border-radius: 10px;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.fch-consent-button:hover {
  background: #f4f7f5;
  border-color: #96aa9d;
}

.fch-consent-button:active {
  transform: translateY(1px);
}

.fch-consent-button--primary {
  color: #ffffff;
  background: #287a4b;
  border-color: #287a4b;
}

.fch-consent-button--primary:hover {
  color: #ffffff;
  background: #20683f;
  border-color: #20683f;
}

.fch-consent-button--secondary {
  color: #35453b;
  background: #f1f4f2;
  border-color: #d7dfda;
}

.fch-consent-button--secondary:hover {
  background: #e6ece8;
  border-color: #bcc9c1;
}

.fch-consent-button--settings {
  color: #246742;
  background: #ffffff;
  border-color: #7daa8e;
}

.fch-consent-button--settings:hover {
  color: #1c5636;
  background: #f0f7f3;
  border-color: #5d9675;
}

.fch-consent-button:focus-visible,
.fch-consent-settings__close:focus-visible,
.fch-consent-category__control:focus-visible {
  outline: 3px solid rgba(32, 104, 63, 0.35);
  outline-offset: 3px;
}

/* Settings modal and backdrop */

.fch-consent-settings {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  overflow: auto;
  background: rgba(18, 31, 23, 0.58);
  backdrop-filter: blur(3px);
}

.fch-consent-settings__panel {
  position: relative;
  width: min(100%, 700px);
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  padding: 1.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #ffffff;
  border: 1px solid #dfe8e2;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(11, 28, 18, 0.28);
}

.fch-consent-settings__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.fch-consent-settings__title {
  padding-right: 0.5rem;
  font-size: 1.5rem;
}

.fch-consent-settings__close {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #425249;
  font-size: 1.75rem;
  line-height: 1;
  background: #f2f5f3;
  border: 1px solid #dce4df;
  border-radius: 50%;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.fch-consent-settings__close:hover {
  color: #183326;
  background: #e7ede9;
  border-color: #bcc9c1;
}

.fch-consent-settings__close:active {
  transform: scale(0.96);
}

.fch-consent-settings__description {
  max-width: 65ch;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

/* Consent category cards */

.fch-consent-categories {
  display: grid;
  gap: 0.85rem;
}

.fch-consent-category {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #dce5df;
  border-radius: 13px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.fch-consent-category:focus-within {
  border-color: #78a68a;
  box-shadow: 0 0 0 3px rgba(40, 122, 75, 0.1);
}

.fch-consent-category:has(.fch-consent-category__control:disabled) {
  background: #f3f6f4;
  border-color: #d5ded8;
}

.fch-consent-category__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.fch-consent-category__label {
  color: #20382b;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.fch-consent-category__description {
  max-width: 58ch;
  margin-top: 0.45rem;
  padding-right: 4.5rem;
  font-size: 0.875rem;
}

.fch-consent-settings__actions {
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* Toggle switches */

.fch-consent-category__control {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 26px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: #aab6ae;
  border: 1px solid #8f9d94;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.fch-consent-category__control::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  content: "";
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(20, 39, 27, 0.22);
  transition: transform 180ms ease;
}

.fch-consent-category__control:checked {
  background: #287a4b;
  border-color: #287a4b;
}

.fch-consent-category__control:checked::before {
  transform: translateX(22px);
}

.fch-consent-category__control:disabled {
  background: #6e8f7a;
  border-color: #6e8f7a;
  cursor: not-allowed;
  opacity: 0.72;
}

.fch-consent-category__control:disabled + * {
  cursor: not-allowed;
}

/* Responsive layout */

@media (max-width: 640px) {
  .fch-consent-banner {
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    padding: 1.25rem;
    border-radius: 15px;
  }

  .fch-consent-banner__actions {
    flex-direction: column;
  }

  .fch-consent-banner__actions .fch-consent-button {
    width: 100%;
  }

  .fch-consent-settings {
    padding: 0.75rem;
    place-items: end center;
  }

  .fch-consent-settings__panel {
    width: 100%;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    padding: 1.25rem;
    border-radius: 16px;
  }

  .fch-consent-settings__title {
    font-size: 1.3rem;
  }

  .fch-consent-category__description {
    padding-right: 0;
  }

  .fch-consent-settings__actions {
    display: block;
  }

  .fch-consent-settings__actions .fch-consent-button {
    width: 100%;
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .fch-consent-button,
  .fch-consent-settings__close,
  .fch-consent-category,
  .fch-consent-category__control,
  .fch-consent-category__control::before {
    transition-duration: 0.01ms;
  }

  .fch-consent-settings {
    backdrop-filter: none;
  }
}

/* Settings link button */

.fch-consent-settings-link {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #ffffff;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.fch-consent-settings-link:hover {
  background: #1e293b;
  border-color: #334155;
}

.fch-consent-settings-link:active {
  transform: translateY(1px);
}

.fch-consent-settings-link:focus-visible {
  outline: 3px solid rgba(51, 65, 85, 0.35);
  outline-offset: 3px;
}

.fch-consent-settings-link__icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}