/*
 * Cookie banner + settings dialog — markup in inc/cookie-consent.php.
 * Same structure as the main site's banner, restyled for this theme: white
 * glass panel like the header pill, the header "Book a Demo" blue on the
 * primary action, and the design-system tokens from assets/style.css.
 */

.cc-banner,
.cc-dialog {
  --cc-accent: var(--blue, #1668ff);
  --cc-grad: linear-gradient(90deg, #367cff 0%, #1668ff 100%);
  --cc-panel: rgba(255, 255, 255, 0.94);
  --cc-line: var(--line, #e6eaf1);
  --cc-text: var(--ink, #0d1526);
  --cc-muted: var(--muted, #5c6779);
  font-family: var(--body-font, "Plus Jakarta Sans", sans-serif);
}

.cc-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 20px;
  z-index: 1040;
  max-width: 1180px;
  margin: 0 auto;
  background: var(--cc-panel);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--cc-line);
  border-radius: var(--r-lg, 24px);
  box-shadow: var(--shadow-lg, 0 30px 70px rgba(13, 21, 38, 0.14));
  color: var(--cc-text);
  animation: cc-rise 0.35s ease-out;
}

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

.cc-banner__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px 18px 22px;
}

.cc-banner__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--cc-grad);
  box-shadow: 0 8px 22px rgba(22, 104, 255, 0.35);
  color: #fff;
}

.cc-banner__icon svg {
  width: 24px;
  height: 24px;
}

.cc-banner__copy {
  flex: 1;
  min-width: 0;
}

.cc-banner__title {
  margin: 0 0 2px;
  font-family: var(--heading-font, inherit);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--cc-text);
}

.cc-banner__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--cc-muted);
}

.cc-banner__text a {
  color: var(--cc-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-banner__text a:hover {
  color: var(--cc-text);
}

.cc-banner__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
}

/* Pill buttons — .cc-btn--primary echoes the header's .nav-demo */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border: 1px solid transparent;
  border-radius: var(--r-pill, 999px);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.cc-btn--primary {
  background: var(--cc-grad);
  color: #fff;
}

.cc-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(22, 104, 255, 0.35);
}

.cc-btn--ghost {
  background: var(--white, #fff);
  border-color: var(--cc-line);
  color: var(--cc-text);
}

.cc-btn--ghost:hover {
  border-color: var(--cc-accent);
  color: var(--cc-accent);
}

.cc-btn--link {
  background: none;
  padding-left: 10px;
  padding-right: 10px;
  color: var(--cc-muted);
  font-weight: 500;
}

.cc-btn--link:hover {
  color: var(--cc-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-btn__arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}

.cc-btn:hover .cc-btn__arrow {
  transform: rotate(45deg);
}

.cc-btn:focus-visible,
.cc-dialog__close:focus-visible,
.cc-switch input:focus-visible + .cc-switch__track {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

/* Settings dialog */

.cc-dialog {
  /* Bootstrap's reboot zeroes <dialog>'s UA margin; restore centring explicitly */
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(580px, calc(100vw - 32px));
  height: fit-content;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--cc-line);
  border-radius: var(--r-lg, 24px);
  background: var(--white, #fff);
  box-shadow: var(--shadow-lg, 0 30px 70px rgba(13, 21, 38, 0.14));
  color: var(--cc-text);
}

.cc-dialog::backdrop {
  background: rgba(13, 21, 38, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.cc-dialog__form {
  padding: 26px 26px 22px;
}

.cc-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cc-dialog__title {
  margin: 0;
  font-family: var(--heading-font, inherit);
  font-size: 24px;
  font-weight: 700;
  color: var(--cc-text);
}

.cc-dialog__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--cc-line);
  border-radius: 50%;
  background: transparent;
  color: var(--cc-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cc-dialog__close:hover {
  background: var(--bg-soft, #f5f7fb);
}

.cc-dialog__intro {
  margin: 8px 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--cc-muted);
}

.cc-dialog__list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cc-category {
  padding: 14px 16px;
  border: 1px solid var(--cc-line);
  border-radius: var(--r, 16px);
  background: var(--bg-soft, #f5f7fb);
}

.cc-category__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  cursor: pointer;
}

.cc-category__label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--cc-text);
}

.cc-category__badge {
  padding: 2px 10px;
  border-radius: var(--r-pill, 999px);
  background: rgba(22, 104, 255, 0.1);
  color: var(--cc-accent);
  font-size: 12px;
  font-weight: 600;
}

.cc-category__desc {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--cc-muted);
}

/* Toggle switch */

.cc-switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
}

.cc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cc-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: #cfd6e3;
  transition: background-color 0.2s;
  pointer-events: none;
}

.cc-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(13, 21, 38, 0.2);
  transition: transform 0.2s;
}

.cc-switch input:checked + .cc-switch__track {
  background: var(--cc-grad);
}

.cc-switch input:checked + .cc-switch__track::after {
  transform: translateX(20px);
}

.cc-switch input:disabled,
.cc-switch input:disabled + .cc-switch__track {
  cursor: not-allowed;
  opacity: 0.6;
}

.cc-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.cc-dialog__actions .cc-btn--link {
  margin-right: auto;
}

@keyframes cc-rise {
  from {
    transform: translateY(24px);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

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

  .cc-btn,
  .cc-btn__arrow {
    transition: none;
  }
}

@media (max-width: 991.98px) {
  .cc-banner__inner {
    flex-wrap: wrap;
  }

  .cc-banner__copy {
    flex-basis: calc(100% - 64px);
  }

  .cc-banner__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 575.98px) {
  .cc-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 18px;
  }

  .cc-banner__inner {
    gap: 14px;
    padding: 16px;
  }

  .cc-banner__icon {
    width: 40px;
    height: 40px;
  }

  .cc-banner__title {
    font-size: 16px;
  }

  .cc-banner__text {
    font-size: 13.5px;
  }

  .cc-banner__actions {
    flex-wrap: wrap;
  }

  .cc-banner__actions .cc-btn--ghost,
  .cc-banner__actions .cc-btn--primary {
    flex: 1;
  }

  .cc-banner__actions .cc-btn--link {
    order: 3;
    flex-basis: 100%;
  }

  .cc-dialog__form {
    padding: 20px 18px 18px;
  }

  .cc-dialog__actions .cc-btn {
    flex: 1 1 100%;
  }

  .cc-dialog__actions .cc-btn--link {
    margin-right: 0;
  }
}
