/* ===========================================================================
   ACW Health — Cookie / Privacy Consent
   Scoped under .acw-cc* class names so nothing collides with the site theme.
   Brand: navy #025089 -> #013a64 gradient, teal accent, WCAG AA contrast.
   =========================================================================== */

:root {
  --acw-cc-navy: #025089;
  --acw-cc-navy-dark: #013a64;
  --acw-cc-teal: #16c0c8;
  --acw-cc-teal-dark: #0f9aa1;
  --acw-cc-ink: #04243d;
  --acw-cc-light: #eaf4fb;
  --acw-cc-link: #aef0f3;
  --acw-cc-radius: 16px;
  --acw-cc-shadow: 0 18px 50px rgba(1, 25, 45, 0.4);
}

/* ---- Banner ------------------------------------------------------------- */
.acw-cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  padding: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

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

.acw-cc-banner-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 1080px;
  background: linear-gradient(135deg, var(--acw-cc-navy), var(--acw-cc-navy-dark));
  color: #fff;
  border: 1px solid rgba(174, 240, 243, 0.18);
  border-radius: var(--acw-cc-radius);
  box-shadow: var(--acw-cc-shadow);
  padding: 22px clamp(20px, 3vw, 30px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px 30px;
  align-items: center;
  animation: acw-cc-rise 0.35s ease both;
}

@keyframes acw-cc-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.acw-cc-title {
  margin: 0 0 6px;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.acw-cc-body {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--acw-cc-light);
  max-width: 70ch;
}

.acw-cc-links {
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 0.88rem;
}

.acw-cc-links a,
.acw-cc-link-btn {
  color: var(--acw-cc-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.acw-cc-link-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.acw-cc-links a:hover,
.acw-cc-link-btn:hover {
  color: #fff;
}

.acw-cc-note {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(234, 244, 251, 0.72);
}

.acw-cc-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: center;
  min-width: 220px;
}

/* ---- Buttons ------------------------------------------------------------ */
.acw-cc-btn {
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  text-align: center;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.acw-cc-btn:hover { transform: translateY(-1px); }
.acw-cc-btn:active { transform: translateY(0); }

.acw-cc-btn-primary {
  background: var(--acw-cc-teal);
  color: var(--acw-cc-ink);
  border-color: var(--acw-cc-teal);
}
.acw-cc-btn-primary:hover {
  background: #2ad0d8;
  border-color: #2ad0d8;
}

.acw-cc-btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}
.acw-cc-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

.acw-cc-btn-outline {
  background: transparent;
  color: var(--acw-cc-navy-dark);
  border-color: var(--acw-cc-navy);
}
.acw-cc-btn-outline:hover {
  background: rgba(2, 80, 137, 0.08);
}

/* Visible focus for keyboard users everywhere */
.acw-cc-banner :focus-visible,
.acw-cc-modal :focus-visible,
.footer-cookie-settings:focus-visible {
  outline: 3px solid #ffd14d;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- Modal -------------------------------------------------------------- */
.acw-cc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(3, 22, 40, 0.62);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: acw-cc-fade 0.2s ease both;
}

.acw-cc-modal-overlay[hidden] { display: none; }

body.acw-cc-no-scroll { overflow: hidden; }

@keyframes acw-cc-fade { from { opacity: 0; } to { opacity: 1; } }

.acw-cc-modal {
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--acw-cc-ink);
  border-radius: 18px;
  box-shadow: var(--acw-cc-shadow);
  overflow: hidden;
  animation: acw-cc-rise 0.25s ease both;
}

.acw-cc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  background: linear-gradient(135deg, var(--acw-cc-navy), var(--acw-cc-navy-dark));
  color: #fff;
}

.acw-cc-modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.acw-cc-modal-close {
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  color: #fff;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.acw-cc-modal-close:hover { background: rgba(255, 255, 255, 0.28); }

.acw-cc-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.acw-cc-modal-intro {
  margin: 0 0 18px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #34536b;
}

.acw-cc-cat {
  border: 1px solid #dbe7f1;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #f7fbfe;
}

.acw-cc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.acw-cc-cat-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--acw-cc-navy-dark);
}

.acw-cc-cat p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #44607a;
}

.acw-cc-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--acw-cc-teal-dark);
  background: rgba(22, 192, 200, 0.14);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---- Accessible switch -------------------------------------------------- */
.acw-cc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.acw-cc-switch input {
  position: absolute;
  opacity: 0;
  width: 52px;
  height: 30px;
  margin: 0;
  cursor: pointer;
}

.acw-cc-slider {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #b7c7d4;
  position: relative;
  transition: background 0.18s ease;
}

.acw-cc-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s ease;
}

.acw-cc-switch input:checked + .acw-cc-slider {
  background: var(--acw-cc-teal);
}
.acw-cc-switch input:checked + .acw-cc-slider::before {
  transform: translateX(22px);
}
.acw-cc-switch input:focus-visible + .acw-cc-slider {
  outline: 3px solid #ffd14d;
  outline-offset: 2px;
}

.acw-cc-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 24px 22px;
  border-top: 1px solid #e6eef5;
}

.acw-cc-modal-actions .acw-cc-btn {
  flex: 1 1 auto;
}

/* ---- Footer "Cookie Settings" link ------------------------------------- */
.footer-cookie-settings {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
  text-align: left;
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 860px) {
  .acw-cc-banner-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .acw-cc-banner-actions {
    min-width: 0;
  }
}

@media (max-width: 600px) {
  .acw-cc-banner {
    padding: 10px;
  }
  .acw-cc-banner-inner {
    padding: 18px;
    border-radius: 14px;
  }
  .acw-cc-modal-actions {
    flex-direction: column;
  }
  .acw-cc-modal-actions .acw-cc-btn {
    width: 100%;
  }
}

/* ---- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .acw-cc-banner-inner,
  .acw-cc-modal,
  .acw-cc-modal-overlay {
    animation: none;
  }
  .acw-cc-btn,
  .acw-cc-slider,
  .acw-cc-slider::before {
    transition: none;
  }
}
