/*
 * Cookie-consent gate (#596). New UI, not part of the designer handoff, so
 * it lives in its own stylesheet rather than editing the vendored files.
 * Uses the centralized tokens from tokens.css (loaded before this file).
 *
 * Also doubles as this app's general "last-loaded override" file for small,
 * targeted fixes to vendored selectors (e.g. #648's WCAG contrast fixes) —
 * consent.css loads last (see app/[lang]/layout.tsx's documented stylesheet
 * order), so a same-specificity override placed here reliably wins the
 * cascade without needing to hand-edit a vendored file that has no existing
 * precedent of direct edits for this kind of change.
 */

.cookie-consent {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 40px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}

.cookie-consent-body {
  flex: 1 1 320px;
  min-width: 0;
}

.cookie-consent-title {
  margin: 0 0 4px;
  font-weight: 700;
}

.cookie-consent-description {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.85;
  line-height: 1.5;
}

.cookie-consent-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.cookie-consent-category {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  cursor: pointer;
}

.cookie-consent-category input {
  margin-top: 4px;
  accent-color: var(--brand-pink);
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 480px) {
  .cookie-consent-actions {
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent-btn {
    width: 100%;
    text-align: center;
  }
}

.cookie-consent-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}

.cookie-consent-btn-primary {
  background: var(--brand-pink);
  color: var(--ink);
}

.cookie-consent-btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.cookie-settings-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 10px;
  font-weight: 400;
  /* #648 (WCAG 2.0 AA / SI 5568): the original #696576 on the footer's
     #ef77fc background (updates.css `.footer.shell`) is 2.34:1, below the
     4.5:1 AA text minimum. var(--ink) is the color the design already uses
     for text on this exact pink elsewhere (updates.css
     `.offer-line strong,.vip-access`) — 7.5:1, no new color introduced. This
     class is defined only here (never overridden elsewhere), so no cascade
     concern. The footer's OTHER contrast fix (`.footer small`, the copyright
     line) lives in updates.css instead — see that file's comment. */
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

/* #648 follow-up (WCAG 2.0 AA / SI 5568), found via axe-core after #648
   shipped — Lighthouse's contrast audit didn't catch this one; axe flagged
   it "incomplete" (can't statically resolve a gradient background), and
   real rendered-pixel sampling confirmed a genuine failure: white text on
   `.surprise-toggle > span`'s `linear-gradient(170deg,#ef77fc,#ffa070)`
   background (surprise.css) measures ~2.0-2.4:1 across the whole gradient —
   at 22px/font-weight:600 this text doesn't qualify for WCAG's large-text
   carve-out (needs ≥700 bold at 18.66px+, or ≥24px regular), so the real
   bar is 4.5:1, not the more lenient 3:1 — the gap is worse than a first
   glance at font-size alone suggests. var(--ink) gives 7.5-9:1 at
   every point on this gradient (same color family as the footer fix above),
   so this is a full color swap, not a shade tweak — white was never a safe
   choice on this background. Overridden here rather than in surprise.css:
   that file has no precedent of direct hand-edits (unlike updates.css for
   the footer fix — see that file's own comment), so this follows the same
   pattern as `.cookie-settings-link` above. */
.surprise-toggle > span {
  color: var(--ink);
}
