/* ============================================================================
 * [spx_analytics A3] Banner de cookies + modal de preferencias (tema Storm).
 * Estilo "goAdopt-like": elegante, discreto, granular. Dark + roxos arcane.
 * Tokens do arcane com fallback (self-contained se o :root nao carregar).
 * z-index ~15000: acima do header sticky (>1030) e abaixo dos lightboxes (20000).
 * Mobile-first: banner empilha os botoes no mobile; modal rola.
 * ========================================================================== */
.spx-consent-banner,
.spx-consent-overlay {
  --cc-bg:      var(--bg-deep, #12122e);
  --cc-surface: var(--surface, #23233c);
  --cc-surf2:   var(--surface-2, #2c2c48);
  --cc-line:    var(--line-soft, rgba(138,79,255,.25));
  --cc-ink:     var(--ink, #f2f1f7);
  --cc-ink2:    var(--ink-2, #c3c1d4);
  --cc-ink3:    var(--ink-3, #918fa8);
  --cc-arc:     var(--arcane, #9b30ff);
  --cc-archi:   var(--arcane-hi, #c07cff);
  --cc-primary: #6200ea;
  --cc-glow:    var(--accent-glow, rgba(140,60,250,.35));
  font-family: 'Inter', system-ui, sans-serif;
}

/* ── banner (barra fixa inferior) ─────────────────────────────────────────── */
.spx-consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 15000;
  background: var(--cc-bg);
  border-top: 1px solid var(--cc-line);
  box-shadow: 0 -10px 40px -12px rgba(0,0,0,.6), 0 -1px 0 rgba(155,48,255,.35);
  color: var(--cc-ink2);
  padding: 14px clamp(14px, 4vw, 34px);
  transform: translateY(110%);
  transition: transform .34s cubic-bezier(.4,0,.2,1);
}
.spx-consent-banner.spx-cc-in { transform: translateY(0); }
.spx-consent-banner::before { /* fio de luz arcane no topo (assinatura do rodape) */
  content: ''; position: absolute; top: -1px; left: 4%; right: 4%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cc-arc) 30%, var(--cc-arc) 70%, transparent);
  opacity: .85; pointer-events: none;
}
.spx-cc-inner {
  max-width: 1320px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 12px;
}
.spx-cc-title {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 1rem; letter-spacing: .04em; color: var(--cc-ink);
  display: flex; align-items: center; gap: 8px; margin-bottom: 3px;
}
.spx-cc-title i { color: var(--cc-archi); font-size: 1.05rem; }
.spx-cc-desc { font-size: .84rem; line-height: 1.5; margin: 0; max-width: 78ch; }
.spx-cc-link { color: var(--cc-archi); text-decoration: underline; text-underline-offset: 2px; }
.spx-cc-link:hover { color: var(--cc-ink); }

.spx-cc-actions { display: flex; flex-direction: column; gap: 9px; }

/* ── botoes (Aceitar e Recusar com o MESMO peso — sem dark pattern LGPD) ───── */
.spx-cc-btn {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
  padding: 11px 18px; border-radius: 12px 4px 12px 4px;
  border: 1px solid transparent; cursor: pointer; line-height: 1.1;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease,
              background .2s ease, color .2s ease, border-radius .2s ease;
}
.spx-cc-btn:hover { transform: translateY(-2px); }
.spx-cc-btn:focus-visible { outline: 2px solid var(--cc-archi); outline-offset: 3px; }
.spx-cc-btn--primary {
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-arc));
  color: #fff; border-color: rgba(155,48,255,.5);
  box-shadow: 0 6px 18px -6px var(--cc-glow);
}
.spx-cc-btn--primary:hover { border-radius: 4px 12px 4px 12px; box-shadow: 0 10px 26px -6px var(--cc-glow); }
.spx-cc-btn--outline {
  background: var(--cc-surface); color: var(--cc-ink); border-color: var(--cc-line);
}
.spx-cc-btn--outline:hover { border-color: var(--cc-arc); border-radius: 4px 12px 4px 12px; }
.spx-cc-btn--ghost {
  background: transparent; color: var(--cc-ink2); border-color: var(--cc-line);
}
.spx-cc-btn--ghost:hover { color: var(--cc-ink); border-color: var(--cc-archi); }

/* desktop: texto e acoes lado a lado; botoes na horizontal */
@media (min-width: 760px) {
  .spx-cc-inner { flex-direction: row; align-items: center; justify-content: space-between; gap: 26px; }
  .spx-cc-actions { flex-direction: row; align-items: center; flex: 0 0 auto; }
}

/* ── modal de preferencias (overlay proprio, nivel raiz do body) ──────────── */
.spx-consent-overlay {
  position: fixed; inset: 0; z-index: 15010;
  background: rgba(8, 8, 20, .68);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px; opacity: 0; transition: opacity .28s ease;
  overflow-y: auto;
}
.spx-consent-overlay.spx-cc-in { opacity: 1; }
.spx-consent-modal {
  position: relative; width: 100%; max-width: 560px; margin: auto;
  background: var(--cc-bg);
  border: 1px solid var(--cc-line);
  border-radius: 18px 4px 18px 18px;
  box-shadow: 0 24px 70px -18px rgba(0,0,0,.8), 0 0 0 1px rgba(155,48,255,.12);
  padding: 22px clamp(18px, 3vw, 26px) 20px;
  color: var(--cc-ink2);
  transform: translateY(14px) scale(.985);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  max-height: calc(100vh - 36px); overflow-y: auto;
}
.spx-consent-overlay.spx-cc-in .spx-consent-modal { transform: translateY(0) scale(1); }
.spx-consent-modal::before {
  content: ''; position: absolute; top: 0; left: 22px; right: 22px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cc-arc) 30%, var(--cc-arc) 70%, transparent);
}
.spx-cc-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.spx-cc-modal-title {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 1.24rem; letter-spacing: .02em; color: var(--cc-ink);
  display: flex; align-items: center; gap: 9px; margin: 0;
}
.spx-cc-modal-title i { color: var(--cc-archi); }
.spx-cc-close {
  background: var(--cc-surface); border: 1px solid var(--cc-line); color: var(--cc-ink2);
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px 3px 10px 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.spx-cc-close:hover { color: #fff; border-color: var(--cc-arc); transform: rotate(90deg); }
.spx-cc-close:focus-visible { outline: 2px solid var(--cc-archi); outline-offset: 2px; }
.spx-cc-modal-sub { font-size: .84rem; line-height: 1.5; margin: 10px 0 16px; }

.spx-cc-cats { display: flex; flex-direction: column; gap: 10px; }
.spx-cc-cat {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: rgba(38, 38, 62, .55);
  border: 1px solid var(--cc-line); border-left: 2px solid rgba(155,48,255,.4);
  border-radius: 12px 4px 12px 12px; padding: 13px 15px;
}
.spx-cc-cat-title {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .98rem;
  letter-spacing: .02em; color: var(--cc-ink);
}
.spx-cc-cat-desc { font-size: .78rem; line-height: 1.45; color: var(--cc-ink3); margin-top: 2px; }

/* ── switch (toggle) ──────────────────────────────────────────────────────── */
.spx-cc-switch { position: relative; flex: 0 0 auto; width: 46px; height: 26px; cursor: pointer; }
.spx-cc-switch.is-locked { cursor: not-allowed; opacity: .85; }
.spx-cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: inherit; }
.spx-cc-slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--cc-surf2); border: 1px solid var(--cc-line);
  transition: background .22s ease, border-color .22s ease;
}
.spx-cc-slider::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--cc-ink3);
  transition: transform .22s cubic-bezier(.4,0,.2,1), background .22s ease;
}
.spx-cc-switch input:checked + .spx-cc-slider {
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-arc));
  border-color: rgba(155,48,255,.55);
}
.spx-cc-switch input:checked + .spx-cc-slider::before { transform: translateX(20px); background: #fff; }
.spx-cc-switch input:focus-visible + .spx-cc-slider { outline: 2px solid var(--cc-archi); outline-offset: 2px; }

.spx-cc-modal-actions {
  display: flex; flex-direction: column; gap: 9px; margin-top: 18px;
  padding-top: 16px; border-top: 1px solid var(--cc-line);
}
@media (min-width: 480px) {
  .spx-cc-modal-actions { flex-direction: row; justify-content: flex-end; }
}

/* ── acessibilidade: sem animacao quando o usuario pede ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .spx-consent-banner,
  .spx-consent-overlay,
  .spx-consent-modal,
  .spx-cc-btn,
  .spx-cc-close,
  .spx-cc-slider,
  .spx-cc-slider::before { transition: none !important; }
  .spx-consent-banner { transform: translateY(0); }
}
