/*
  AquaPulse cookie / embedded-content consent UI.
  Self-contained on purpose: this file is loaded on pages that use the
  main site's design tokens (index.html, tools.html, knowledge.html, guide
  pages, etc.) as well as the simpler legal-page template (privacy.html,
  cookie-policy.html), which does not define the same CSS custom
  properties. All colours/spacing here are therefore hard-coded to
  AquaPulse's existing brand values rather than inherited, so the banner
  looks the same everywhere regardless of the host page's own styles.
*/

.aq-cookie-banner,
.aq-cookie-overlay,
.aq-cookie-overlay * {
  box-sizing: border-box;
}

.aq-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  /* Deliberately just under the 32-bit signed max: this must stay above
     any stacking context already on the page (including future ones)
     without needing to track what the highest existing z-index is. */
  z-index: 2147483000;
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #dde5ee;
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(15, 32, 57, 0.18);
  padding: 20px 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  color: #0f2039;
}

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

.aq-cookie-banner p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
  color: #33445c;
}

.aq-cookie-banner a {
  color: #2f5fe0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.aq-cookie-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.aq-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
}

.aq-cookie-btn-primary {
  background: #2f5fe0;
  color: #ffffff;
}

.aq-cookie-btn-primary:hover {
  opacity: 0.92;
}

.aq-cookie-btn-ghost {
  background: #ffffff;
  border-color: #c7d3e0;
  color: #0f2039;
}

.aq-cookie-btn-ghost:hover {
  background: #f3f6fa;
}

.aq-cookie-btn-text {
  background: none;
  border: 0;
  color: #33445c;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 10px 4px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-left: auto;
}

.aq-cookie-btn-text:hover {
  color: #2f5fe0;
}

.aq-cookie-btn:focus-visible,
.aq-cookie-btn-text:focus-visible,
.aq-cookie-switch input:focus-visible + .aq-cookie-slider {
  outline: 3px solid #2f5fe0;
  outline-offset: 2px;
}

/* Preferences dialog */

.aq-cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  background: rgba(12, 28, 51, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.aq-cookie-overlay[hidden] {
  display: none;
}

.aq-cookie-modal {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 32, 57, 0.28);
  padding: clamp(22px, 4vw, 30px);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  color: #0f2039;
}

.aq-cookie-modal h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.aq-cookie-modal > p {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.65;
  color: #33445c;
}

.aq-cookie-modal a {
  color: #2f5fe0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.aq-cookie-category {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #dde5ee;
}

.aq-cookie-category:first-of-type {
  border-top: 0;
}

.aq-cookie-category-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.aq-cookie-category-copy h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 800;
  color: #0f2039;
}

.aq-cookie-category-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #5b6b80;
}

.aq-cookie-category-status {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b6b80;
}

.aq-cookie-switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  margin-top: 2px;
}

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

.aq-cookie-switch input:disabled {
  cursor: not-allowed;
}

.aq-cookie-slider {
  position: absolute;
  inset: 0;
  background: #c7d3e0;
  border-radius: 999px;
  transition: background 0.15s ease;
  pointer-events: none;
}

.aq-cookie-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(15, 32, 57, 0.3);
  transition: transform 0.15s ease;
}

.aq-cookie-switch input:checked + .aq-cookie-slider {
  background: #2f5fe0;
}

.aq-cookie-switch input:checked + .aq-cookie-slider::before {
  transform: translateX(18px);
}

.aq-cookie-switch input:disabled + .aq-cookie-slider {
  opacity: 0.55;
}

.aq-cookie-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #dde5ee;
}

.aq-cookie-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #dde5ee;
  background: #ffffff;
  color: #0f2039;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.aq-cookie-modal-close:hover {
  background: #f3f6fa;
}

.aq-cookie-modal-inner {
  position: relative;
}

/* Footer "Cookie Settings" control, styled to match surrounding footer links */

.footer-cookie-settings {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  line-height: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.footer-cookie-settings:hover {
  color: #2f5fe0;
}

.footer-cookie-settings:focus-visible {
  outline: 3px solid #2f5fe0;
  outline-offset: 2px;
}

/* Embedded-content placeholder (e.g. the homepage YouTube facade) */

.aq-consent-embed-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: #0b1526;
  color: #eef3fa;
}

.aq-consent-embed-placeholder p {
  margin: 0;
  max-width: 44ch;
  font-size: 13px;
  line-height: 1.6;
  color: #9fb0c7;
}

.aq-consent-embed-placeholder a {
  color: #9fd1ff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.aq-consent-embed-placeholder a:focus-visible {
  outline: 3px solid #9fd1ff;
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .aq-cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 16px 16px 18px;
  }

  .aq-cookie-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .aq-cookie-btn {
    width: 100%;
  }

  .aq-cookie-btn-text {
    margin-left: 0;
    order: -1;
    align-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aq-cookie-slider,
  .aq-cookie-slider::before {
    transition-duration: 0.01ms;
  }
}
