/* ============================================================
   consent.css — shared Consent UI stylesheet (SINGLE SOURCE)

   The cookie consent banner + preferences modal are injected at
   runtime by the ConsentBanner module in scripts.js on EVERY page.
   This stylesheet carries their styles so any page — built pages
   (via the _layouts templates) and standalone landing pages
   (homepage, /fee-audit/, future LPs) — renders the consent UI
   correctly just by linking it:  <link rel="stylesheet" href="/consent.css">

   It uses the ASF design tokens (--asf-ink, --asf-magenta, etc.);
   every page that links this also loads a stylesheet that defines
   those tokens (styles.css or a landing page's own CSS). Fallback
   values are inlined below so the UI stays legible even if a future
   page omits the tokens.
   ============================================================ */

#cookie-banner[hidden],
#cookie-preferences[hidden] {
  display: none !important;
}

#cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px;
  background: var(--asf-ink, #0E0E14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(14, 14, 20, 0.35);
  font-family: "Inter", system-ui, sans-serif;
}

.cookie-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cookie-banner-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.cookie-banner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-btn, 999px);
  border: 1.5px solid transparent;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 100ms ease;
}

.cookie-banner-btn:focus-visible {
  outline: 3px solid var(--asf-amber, #FFC24B);
  outline-offset: 3px;
}

.cookie-banner-btn:active {
  transform: scale(0.97);
}

.cookie-banner-btn-primary {
  background: var(--asf-magenta, #C4234F);
  color: #fff;
  border-color: var(--asf-magenta, #C4234F);
  box-shadow: 0 8px 24px rgba(196, 35, 79, 0.35);
}

.cookie-banner-btn-primary:hover {
  background: var(--asf-coral, #FF6A5B);
  border-color: var(--asf-coral, #FF6A5B);
}

.cookie-banner-btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.cookie-banner-btn-secondary:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.cookie-banner-btn-tertiary {
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner-btn-tertiary:hover {
  color: #fff;
}

#cookie-preferences {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.cookie-preferences-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 20, 0.55);
}

.cookie-preferences-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  color: var(--asf-ink, #0E0E14);
  border-radius: var(--radius-card, 20px);
  box-shadow: 0 24px 60px rgba(14, 14, 20, 0.25);
  padding: 28px;
  font-family: "Inter", system-ui, sans-serif;
}

.cookie-preferences-title {
  margin: 0 0 8px;
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cookie-preferences-desc {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--asf-steel, #6B6B78);
}

.cookie-preferences-categories {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cookie-category {
  padding: 16px;
  border: 1px solid var(--asf-cloud, #E6E1DA);
  border-radius: 12px;
  background: var(--asf-mist, #F5F3F0);
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.cookie-category-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.cookie-category-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--asf-magenta, #C4234F);
  cursor: pointer;
}

.cookie-category-toggle input[type="checkbox"][disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-category-name {
  color: var(--asf-ink, #0E0E14);
}

.cookie-category-status {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--asf-signal, #15A66B);
}

.cookie-category-description {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--asf-graphite, #2A2A33);
}

.cookie-preferences-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.cookie-preferences-actions .cookie-banner-btn-secondary {
  color: var(--asf-ink, #0E0E14);
  border-color: rgba(14, 14, 20, 0.18);
}

.cookie-preferences-actions .cookie-banner-btn-secondary:hover {
  background: rgba(14, 14, 20, 0.04);
  border-color: rgba(14, 14, 20, 0.32);
}

@media (max-width: 639px) {
  #cookie-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 18px 18px;
    border-radius: 14px;
  }
  .cookie-banner-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-banner-btn {
    width: 100%;
  }
  .cookie-preferences-panel {
    padding: 22px;
    max-height: calc(100vh - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner-btn {
    transition: none;
  }
  .cookie-banner-btn:active {
    transform: none;
  }
}

/* Hide the consent UI when printing (standalone-page parity with styles.css). */
@media print {
  #cookie-banner,
  #cookie-preferences { display: none !important; }
}
