/* =============================================================================
   COOKIE CONSENT MANAGER — STYLESHEET
   Aungier Street Clinic. Re-skinned to the site's own design system:
   Primary Blue #4285F4 / Primary Dark #1E5CC8 / Accent #6FCF97,
   Cormorant Garamond (display) + Inter (body), pill buttons matching .btn.
   Every value is a CSS custom property below — change once, applies everywhere.
   Scoped under #cc-root so it never leaks into the host page's styles.
============================================================================= */

:root {
  /* Brand — mapped to the site's tokens */
  --cc-primary:        #4285F4;   /* Primary Blue — primary buttons, toggle-on */
  --cc-primary-deep:   #1E5CC8;   /* Primary Dark — hover / active */
  --cc-primary-tint:   #EAF3FF;   /* Light Blue — icon badge bg, focus rings */
  --cc-accent:         #6FCF97;   /* Accent/mint — icon ring, header rule */

  /* Neutrals */
  --cc-bg:             #FFFFFF;
  --cc-surface:        #F8FAFC;
  --cc-text:           #0F172A;
  --cc-text-muted:     #64748B;
  --cc-border:         #E2E8F0;
  --cc-track-off:      #CBD5E1;

  /* Shape */
  --cc-radius-card:    22px;
  --cc-radius-sm:      12px;
  --cc-radius-pill:    999px;
  --cc-shadow:         0 24px 64px rgba(15,23,42,.16), 0 2px 10px rgba(15,23,42,.08);

  /* Type — already loaded by the site's <head> */
  --cc-font-display:   "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --cc-font-body:      "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Motion */
  --cc-transition:     220ms cubic-bezier(.4, 0, .2, 1);

  /* Stacking — above the sticky header (200) and mobile drawer (300) */
  --cc-z: 2147483000;
}

#cc-root, #cc-root * { box-sizing: border-box; }
#cc-root {
  font-family: var(--cc-font-body);
  color: var(--cc-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}
#cc-root button { font-family: inherit; }
#cc-root p { margin: 0; }

/* ---- Banner ---- */
.cc-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--cc-z);
  padding: 16px;
  transform: translateY(130%);
  opacity: 0;
  transition: transform var(--cc-transition), opacity var(--cc-transition);
  pointer-events: none;
}
.cc-banner.is-visible { transform: translateY(0); opacity: 1; pointer-events: auto; }

.cc-banner__inner {
  max-width: 1160px;
  margin: 0 auto;
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-card) var(--cc-radius-card) var(--cc-radius-sm) var(--cc-radius-sm);
  box-shadow: var(--cc-shadow);
  padding: 26px 30px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.cc-banner__icon {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--cc-primary-tint);
  color: var(--cc-primary);
  border: 1.5px solid var(--cc-accent);
  display: flex; align-items: center; justify-content: center;
}
.cc-banner__icon svg { width: 24px; height: 24px; }

.cc-banner__content { flex: 1 1 380px; min-width: 220px; }
.cc-banner__title {
  margin: 0 0 6px;
  font-family: var(--cc-font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: .01em;
  color: var(--cc-text);
}
.cc-banner__text { font-size: 14px; color: var(--cc-text-muted); }
.cc-banner__text a { color: var(--cc-primary); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.cc-banner__text a:hover { color: var(--cc-primary-deep); }

.cc-banner__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

/* ---- Buttons ----
   "Accept All" and "Reject Non-Essential" are equal-weight, same size — this
   is a DPC/EDPB requirement, not a style choice. Only "Manage Preferences"
   (which opens info rather than deciding) is the quieter tertiary action.
   Pill radius matches the site's .btn. */
.cc-btn {
  appearance: none;
  border: 2px solid transparent;
  border-radius: var(--cc-radius-pill);
  padding: 11px 22px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--cc-transition), border-color var(--cc-transition), color var(--cc-transition), transform 120ms ease;
}
.cc-btn:active { transform: translateY(1px); }
.cc-btn:focus-visible { outline: 3px solid var(--cc-primary-tint); outline-offset: 2px; }

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

.cc-btn--outline { background: transparent; border-color: var(--cc-primary); color: var(--cc-primary); }
.cc-btn--outline:hover { background: var(--cc-primary-tint); }

.cc-btn--ghost { background: transparent; border-color: transparent; color: var(--cc-text-muted); text-decoration: underline; text-underline-offset: 2px; }
.cc-btn--ghost:hover { color: var(--cc-text); }

/* ---- Modal / Preference Centre ---- */
.cc-modal { position: fixed; inset: 0; z-index: calc(var(--cc-z) + 1); display: none; }
.cc-modal.is-visible { display: block; }

.cc-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .55);
  opacity: 0;
  transition: opacity var(--cc-transition);
}
.cc-modal.is-visible .cc-modal__backdrop { opacity: 1; }

.cc-modal__panel {
  position: relative;
  width: min(560px, calc(100% - 32px));
  max-height: min(680px, calc(100% - 64px));
  margin: 5vh auto;
  background: var(--cc-bg);
  border-radius: var(--cc-radius-card) var(--cc-radius-card) 14px 14px;
  box-shadow: var(--cc-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(.98);
  opacity: 0;
  transition: transform var(--cc-transition), opacity var(--cc-transition);
}
.cc-modal.is-visible .cc-modal__panel { transform: translateY(0) scale(1); opacity: 1; }

.cc-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px 18px;
  border-bottom: 2px solid var(--cc-accent);
}
.cc-modal__header h2 {
  margin: 0;
  font-family: var(--cc-font-display);
  font-weight: 600;
  font-size: 24px;
}
.cc-modal__close {
  appearance: none; border: none; background: var(--cc-surface);
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 18px; line-height: 1; color: var(--cc-text-muted); cursor: pointer;
  flex: 0 0 auto;
}
.cc-modal__close:hover { background: var(--cc-border); color: var(--cc-text); }
.cc-modal__close:focus-visible { outline: 3px solid var(--cc-primary-tint); outline-offset: 2px; }

.cc-modal__body { padding: 20px 26px; overflow-y: auto; }
.cc-modal__intro { display: block; margin: 0 0 18px; font-size: 13.5px; color: var(--cc-text-muted); }

.cc-category {
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  padding: 15px 17px;
  margin-bottom: 12px;
}
.cc-category__row { display: flex; align-items: center; gap: 12px; }
.cc-category__name { flex: 1; font-size: 14.5px; font-weight: 700; }
.cc-category__badge {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--cc-primary-deep); background: var(--cc-primary-tint);
  padding: 3px 8px; border-radius: var(--cc-radius-pill); margin-left: 8px;
  vertical-align: middle;
}
.cc-category__desc { margin: 8px 0 0; font-size: 13px; color: var(--cc-text-muted); line-height: 1.6; }

.cc-category__details { margin-top: 10px; }
.cc-category__details summary {
  cursor: pointer; font-size: 12.5px; color: var(--cc-primary); font-weight: 600;
  list-style: none;
}
.cc-category__details summary::-webkit-details-marker { display: none; }
.cc-category__details summary::before { content: "+ "; }
.cc-category__details[open] summary::before { content: "\2212 "; }

.cc-cookie-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
.cc-cookie-table th, .cc-cookie-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--cc-border); color: var(--cc-text-muted); vertical-align: top; }
.cc-cookie-table th { color: var(--cc-text); font-weight: 700; }

.cc-modal__footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 26px; border-top: 1px solid var(--cc-border); background: var(--cc-surface);
  flex: 0 0 auto;
}

/* ---- Toggle switch (colour is never the only signal — On/Off text sits beside it) ---- */
.cc-toggle-wrap { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cc-toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.cc-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-toggle__track {
  position: absolute; inset: 0; background: var(--cc-track-off);
  border-radius: var(--cc-radius-pill); transition: background var(--cc-transition);
}
.cc-toggle__track::before {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  transition: transform var(--cc-transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.cc-toggle input:checked + .cc-toggle__track { background: var(--cc-primary); }
.cc-toggle input:checked + .cc-toggle__track::before { transform: translateX(18px); }
.cc-toggle input:disabled + .cc-toggle__track { opacity: .6; cursor: not-allowed; }
.cc-toggle input:focus-visible + .cc-toggle__track { outline: 3px solid var(--cc-primary-tint); outline-offset: 2px; }
.cc-toggle__state { font-size: 11.5px; font-weight: 700; color: var(--cc-text-muted); width: 26px; }

/* ---- Floating "Cookie Settings" re-open control ---- */
.cc-settings-btn {
  position: fixed; left: 16px; bottom: 16px; z-index: var(--cc-z);
  display: none; align-items: center; gap: 8px;
  background: var(--cc-bg); border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-pill); padding: 10px 16px 10px 12px;
  box-shadow: var(--cc-shadow); font-size: 12.5px; font-weight: 600; color: var(--cc-text);
  cursor: pointer;
}
.cc-settings-btn.is-visible { display: inline-flex; }
.cc-settings-btn svg { width: 18px; height: 18px; color: var(--cc-primary); }
.cc-settings-btn:hover { border-color: var(--cc-primary); }
.cc-settings-btn:focus-visible { outline: 3px solid var(--cc-primary-tint); outline-offset: 2px; }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .cc-banner__inner { flex-wrap: wrap; padding: 22px; }
  .cc-banner__actions { width: 100%; margin-left: 0; }
  .cc-banner__actions .cc-btn { flex: 1 1 auto; }
  .cc-modal__panel { margin: auto; max-height: calc(100% - 32px); }
  .cc-settings-btn span { display: none; }
  .cc-settings-btn { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-modal__panel, .cc-modal__backdrop, .cc-toggle__track, .cc-toggle__track::before {
    transition: none !important;
  }
}
@media print {
  .cc-banner, .cc-modal, .cc-settings-btn { display: none !important; }
}
