/* Banner de cookies. Cartão compacto no canto inferior direito no desktop, barra inferior no mobile.
   Tokens da home: roxo #600E8F / #430E61, lilás #E9E5FF, Poppins, botões em pílula.
   Aceitar e Recusar compartilham a mesma classe: mesmo tamanho, peso e foco; só a cor muda
   (Aceitar preenchido, Recusar contornado), ambos com contraste AA. A home não tem tema escuro,
   então o banner também não segue prefers-color-scheme. */

.consentimento[hidden] {
  display: none !important;
}

.consentimento {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100001;
  box-sizing: border-box;
  width: min(400px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid #E9E5FF;
  border-radius: 20px;
  background: #ffffff;
  color: #1a1a1a;
  box-shadow: 0 10px 32px rgba(67, 14, 97, 0.2), 0 2px 6px rgba(0, 0, 0, 0.08);
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  animation: consentimento-entrada 240ms ease-out;
}

.consentimento:focus {
  outline: 3px solid #430E61;
  outline-offset: 3px;
}

.consentimento .consentimento__titulo {
  margin: 0 0 4px;
  padding: 0;
  color: #430E61;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.consentimento .consentimento__texto {
  display: inline;
  margin: 0;
  color: #3d3d3d;
  font-size: 13.5px;
  line-height: 1.5;
}

.consentimento .consentimento__link {
  margin-left: 4px;
  color: #600E8F;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consentimento .consentimento__link:hover {
  color: #430E61;
}

.consentimento .consentimento__link:focus-visible,
.consentimento .consentimento__botao:focus-visible {
  outline: 3px solid #430E61;
  outline-offset: 2px;
}

.consentimento .consentimento__acoes {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.consentimento .consentimento__botao {
  flex: 1 1 0;
  min-width: 44px;
  min-height: 40px;
  margin: 0;
  padding: 8px 16px;
  border: 2px solid #600E8F;
  border-radius: 999px;
  background: #600E8F;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background-color 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out;
}

.consentimento .consentimento__botao:hover {
  border-color: #430E61;
  background: #430E61;
}

.consentimento .consentimento__botao[data-consentimento-acao="recusar"] {
  background: #ffffff;
  color: #600E8F;
}

.consentimento .consentimento__botao[data-consentimento-acao="recusar"]:hover {
  border-color: #430E61;
  background: #E9E5FF;
  color: #430E61;
}

@keyframes consentimento-entrada {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Desktop e tablet: o cartão ocupa o canto inferior direito; com ele aberto, o balão do WhatsApp sobe acima dele
   (cartão ~171 px + 24 px de margem + 17 px de folga) e volta ao lugar quando o banner fecha. */
@media (min-width: 601px) {
  body:has(.consentimento:not([hidden])) #wl-fab {
    bottom: 212px;
  }

  body:has(.consentimento:not([hidden])) #wl-panel {
    bottom: 284px;
    max-height: calc(100dvh - 300px);
  }
}

/* Mobile: barra inferior compacta, largura total, sem cobrir o balão do WhatsApp (que sobe enquanto o banner está aberto). */
@media (max-width: 600px) {
  .consentimento {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 24px rgba(67, 14, 97, 0.18);
  }

  .consentimento .consentimento__titulo {
    margin-bottom: 2px;
    font-size: 14px;
  }

  .consentimento .consentimento__texto,
  .consentimento .consentimento__link {
    font-size: 13px;
    line-height: 1.45;
  }

  .consentimento .consentimento__acoes {
    gap: 8px;
    margin-top: 8px;
  }

  .consentimento .consentimento__botao {
    min-height: 44px;
    padding: 6px 12px;
    font-size: 13.5px;
  }

  body:has(.consentimento:not([hidden])) #wl-fab,
  body.home:has(.consentimento:not([hidden])) #wl-fab,
  body.page-modulo:has(.consentimento:not([hidden])) #wl-fab {
    bottom: 164px !important;
  }

  body:has(.consentimento:not([hidden])) #wl-panel {
    bottom: 236px;
    max-height: calc(100dvh - 252px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .consentimento {
    animation: none;
  }

  .consentimento .consentimento__botao {
    transition: none;
  }
}
