/* Onda 9 (Fase 197) — banner e central de preferências de cookies.
   Regras: sem layout shift (o painel é fixed, fora do fluxo), foco visível,
   ESC fecha, contraste AA, mobile-first. */

.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 120;
  max-width: 430px;
  margin: 0 auto;
  background: #fff;
  color: #1c1c1c;
  border: 1px solid #d9d9d9;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
  padding: 12px 14px;
  /* espaço reservado: o banner só entra depois, sem empurrar o conteúdo */
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.cookie-banner.is-visible { visibility: visible; opacity: 1; transform: none; }

.cookie-banner h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-family: 'Poppins', system-ui, sans-serif;
  color: #2d3277;
}
.cookie-banner h2::before { content: "🍪 "; }
.cookie-banner p {
  margin: 0 0 9px;
  font-size: .78rem;
  line-height: 1.4;
  color: #333;
}
.cookie-banner .cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cookie-banner .cookie-actions .btn { flex: 1 1 40%; padding: 9px 10px; font-size: .82rem; }
.cookie-banner a { color: #2968c8; text-decoration: underline; }

/* Central de preferências (mesma casca, painel maior) */
.cookie-prefs {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .45);
}
.cookie-prefs[hidden] { display: none; }

.cookie-prefs .panel {
  background: #fff;
  color: #1c1c1c;
  border-radius: 12px;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
}
.cookie-prefs h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: #2d3277;
  font-family: 'Poppins', system-ui, sans-serif;
}
.cookie-prefs .muted { color: #737373; font-size: .82rem; }

.cookie-cat {
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}
.cookie-cat header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cookie-cat header label { font-weight: 700; font-size: .92rem; }
.cookie-cat p { margin: 6px 0 0; font-size: .82rem; color: #333; line-height: 1.45; }
.cookie-cat.is-locked { background: #f7f9fc; }
.cookie-cat.is-locked .lock-note { font-size: .76rem; color: #007a3d; font-weight: 600; }

/* switch acessível */
.cookie-switch { display: inline-flex; align-items: center; gap: 8px; }
.cookie-switch input { width: 18px; height: 18px; accent-color: #2d3277; }

.cookie-prefs .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.cookie-prefs .actions .btn { flex: 1 1 40%; }

:focus-visible { outline: 3px solid #2968c8; outline-offset: 2px; }

@media (max-width: 480px) {
  .cookie-banner {
    left: 0; right: 0; bottom: 0; max-width: none;
    border-radius: 14px 14px 0 0; padding: 12px 14px 10px;
  }
  .cookie-banner h2 { font-size: .95rem; margin-bottom: 4px; }
  .cookie-banner p { font-size: .76rem; }
  .cookie-banner .cookie-actions .btn { flex: 1 1 calc(50% - 4px); }
  .cookie-banner .cookie-actions .btn[data-consent="customize"] { flex-basis: 100%; }
  .cookie-prefs .actions .btn { flex: 1 1 100%; }
}

/* link textual no rodapé (mesmo peso dos outros, sem virar "botão grande") */
.linklike {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
