/* the cookie banner (public/consent.js) on pages that do not load
   style.css (/privacy, /terms, /trading-disclaimers.html). The banner block
   below is a verbatim copy of the banner block in style.css, and the two
   button rules are style.css .btn-primary / .btn-secondary scoped to the
   banner. Keep them in sync (a unit guard checks it).
   The style.css tokens the banner uses are defined on the banner only, so
   nothing else on these pages changes. */
.consent-banner {
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --transition-fast: 0.2s ease;
}

/* cookie consent banner (public/consent.js). Fixed to the bottom,
   not a modal: the page stays usable, and "Necessary only" is one tap.
   sits above the phone/tablet drawer (z-50) and its account menu
   (z-60), so every banner button stays visible and clickable with the
   drawer open, and below modals (z-1000) so legal/privacy modals open over
   it. Buttons reuse .btn-primary (brand green, dark text) and
   .btn-secondary. */
.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  padding: 0 1rem 1rem;
  pointer-events: none;
}
.consent-banner[hidden] {
  display: none;
}
/* light scrim behind the expanded panel only. A pseudo-element of
   the root, so it goes whenever the banner hides or collapses. It takes
   pointer events (the page behind is not clickable) but clicking it does
   nothing: consent is an explicit choice. */
.consent-banner--expanded::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: color-mix(in srgb, var(--color-bg-base) 50%, transparent);
  pointer-events: auto;
}
.consent-banner__inner {
  pointer-events: auto;
  max-width: 48rem;
  margin: 0 auto;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.25rem;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 1.5;
}
.consent-banner__title {
  margin: 0 0 0.5rem;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.consent-banner__text {
  margin: 0;
  color: var(--color-text-secondary);
}
.consent-banner__link {
  color: var(--color-text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.consent-banner__link:hover {
  color: var(--color-primary-500);
}
.consent-banner__panel {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.consent-banner__panel[hidden] {
  display: none;
}
.consent-banner__row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background-color: var(--color-bg-elevated);
  cursor: pointer;
}
.consent-banner__check {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
  accent-color: var(--color-primary-500);
}
.consent-banner__check:disabled {
  cursor: not-allowed;
}
.consent-banner__row-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.consent-banner__row-label {
  font-weight: 500;
  color: var(--color-text-primary);
}
.consent-banner__row-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
}
.consent-banner__actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}
.consent-banner__btn[hidden] {
  display: none;
}
.consent-banner__btn:focus-visible,
.consent-banner__check:focus-visible,
.consent-banner__link:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .consent-banner {
    padding: 0 0.5rem 0.5rem;
  }
  .consent-banner__inner {
    padding: 1rem;
  }
  .consent-banner__actions > .consent-banner__btn {
    flex: 1 1 100%;
    min-height: 44px;
  }
}
/* slimmer banner on phones so it does not cover the landing hero
   CTA. Same wording and buttons; less padding, smaller text, and the buttons
   share a row (wrapping only when they must) at a 44px tap height. Necessary
   only and Accept all keep one shared size. */
@media (max-width: 639.98px) {
  .consent-banner {
    padding: 0 0.5rem 0.5rem;
  }
  .consent-banner__inner {
    padding: 0.75rem;
    font-size: 13px;
    line-height: 1.4;
  }
  .consent-banner__title {
    margin-bottom: 0.25rem;
    font-size: 14px;
  }
  /* same disclosure text, smaller box than the page hero heading,
     so the banner is never the largest paint on a phone. */
  .consent-banner__text {
    font-size: 12px;
    line-height: 1.25;
  }
  .consent-banner__actions {
    margin-top: 0.75rem;
  }
  .consent-banner__panel {
    margin-top: 0.75rem;
  }
  .consent-banner__actions > .consent-banner__btn {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 0.375rem 0.75rem;
    font-size: 13px;
  }
}

/* Banner buttons: style.css .btn-primary / .btn-secondary, banner-scoped. */
.consent-banner .btn-primary {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--border-radius-md);
  background-color: var(--color-primary-500);
  color: var(--color-text-on-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition-fast);
}
.consent-banner .btn-primary:hover {
  background-color: var(--color-primary-400);
}
.consent-banner .btn-secondary {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.consent-banner .btn-secondary:hover {
  background-color: var(--color-bg-muted);
  border-color: var(--color-border-strong);
}
