/* =========================================================================
   Formulário de captura + consentimento LGPD. COMPARTILHADO por tudo que
   coleta lead: as LPs (assine, whatsapp) e o bloco do Boletim na home.
   Depende de marca.css, que vem antes.

   Existe separado de propósito. A mecânica do consentimento (caixa desmarcada,
   destaque ao esquecer, modal com o texto) é jurídica, não estética: se cada
   página tivesse a sua cópia, uma divergiria e coletaria consentimento inválido
   sem ninguém perceber. Um arquivo só, um comportamento só.

   Cada página define --acento (amarelo na newsletter, verde no WhatsApp).
   ========================================================================= */

:root {
  --acento: var(--gold);
  --acento-texto: var(--navy-deep);
}

form { display: flex; flex-direction: column; gap: 12px; }

/* Floating label: o rótulo mora DENTRO do campo e sobe quando ele recebe foco
   ou já tem conteúdo. Compacta o form sem perder o rótulo (um placeholder puro
   sumiria ao digitar e deixaria o campo anônimo).
   Depende de: input ANTES do label no HTML (seletor +) e placeholder=" ",
   que é o que faz :placeholder-shown valer como "campo vazio". */
.campo { position: relative; }
.campo input {
  width: 100%;
  height: 58px;
  padding: 24px 16px 8px;
  border-radius: 10px;
  border: 1px solid var(--linha);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.campo label {
  position: absolute;
  left: 17px;
  top: 18px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(238, 242, 251, 0.45);
  pointer-events: none;
  transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease;
}
.campo input:focus + label,
.campo input:not(:placeholder-shown) + label {
  top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--acento);
}
.campo input:focus {
  outline: none;
  border-color: var(--acento);
  background: rgba(255, 255, 255, 0.09);
}
.campo input[aria-invalid="true"] { border-color: var(--erro); }
/* O autofill do Chrome pinta o campo de branco e apaga o texto claro. */
.campo input:-webkit-autofill,
.campo input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 60px #101f45 inset;
  caret-color: var(--text);
}

/* Honeypot: fora da tela para humanos, preenchível por bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Consentimento LGPD ----
   A caixa NUNCA pode nascer marcada nem ser marcada por script: o art. 8º da
   LGPD exige manifestação livre e inequívoca. Consentimento pré-marcado é o
   mesmo que consentimento nenhum. */
.consentimento {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
}
.consentimento input[type="checkbox"] {
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--linha);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.consentimento input[type="checkbox"]:checked {
  background: var(--acento);
  border-color: var(--acento);
}
.consentimento input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: 5px;
  height: 10px;
  margin: 1.5px auto 0;
  border: solid var(--acento-texto);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.consentimento input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}
.consentimento a {
  color: var(--acento);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* Enviou sem marcar: a caixa se acende em vez de só aparecer um erro embaixo do
   botão, que passa despercebido. Reduz o atrito sem pré-marcar nada. */
.consentimento.faltando {
  color: var(--text);
  animation: chamar 0.4s ease 2;
}
.consentimento.faltando input[type="checkbox"] {
  border-color: var(--erro);
  background: rgba(255, 138, 122, 0.12);
}
@keyframes chamar {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .consentimento.faltando { animation: none; }
}

/* ---- Modal da declaração ---- */
.modal-fundo {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(3, 8, 20, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.modal-caixa {
  width: 100%;
  max-width: 720px;
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  background: #0c1a3a;
  border: 1px solid var(--linha);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal-caixa h2 {
  font-size: 19px;
  line-height: 1.3;
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-corpo {
  overflow-y: auto;
  padding: 20px 28px;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(238, 242, 251, 0.78);
}
.modal-corpo p + p { margin-top: 14px; }
.modal-corpo strong { color: var(--text); }
.modal-rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--muted);
}
.modal-fechar {
  height: 42px;
  margin: 0;
  padding: 0 26px;
  font-size: 15px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--acento);
  color: var(--acento-texto);
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }
button:disabled { opacity: 0.6; cursor: progress; }
button svg { width: 22px; height: 22px; flex: none; }

.aviso { font-size: 12.5px; color: var(--muted); line-height: 1.5; text-align: center; }
.msg { font-size: 14px; line-height: 1.5; min-height: 20px; }
.msg[data-tipo="erro"] { color: var(--erro); }
.msg[data-tipo="ok"] { color: var(--acento); }

.sucesso { text-align: center; padding: 24px 0; }
.sucesso .check {
  width: 64px; height: 64px; margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--acento);
  display: grid;
  place-items: center;
}
.sucesso .check svg { width: 34px; height: 34px; color: var(--acento-texto); }
.sucesso h2 { font-size: 26px; margin-bottom: 12px; }
.sucesso p { color: var(--muted); line-height: 1.6; }
.sucesso .link-manual {
  display: inline-block;
  margin-top: 18px;
  color: var(--acento);
  font-weight: 700;
  font-size: 15px;
}
[hidden] { display: none !important; }
