/* ============================================
   POPUP DE PRÉ-CADASTRO (/js/lead-form.js)
   Módulo independente: usado na raiz, /meta/, /fpr-v2/, /fpr-V1/, /v2/ e 404,
   que têm folhas de estilo diferentes — por isso os tokens ficam aqui, com
   prefixo próprio, e nada depende de /css/main.css.
   ============================================ */

.lead-form {
  --lf-forest: #1c2419;
  --lf-cream: #f2e9de;
  --lf-gold: #c9a063;
  --lf-gold-light: #e6c896;
  --lf-gold-deep: #a07d44;
  --lf-line: rgba(242, 233, 222, 0.18);
  --lf-error: #f0a58f;
  --lf-ease: cubic-bezier(0.16, 1, 0.3, 1);

  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--lf-line);
  border-radius: 22px;
  background: var(--lf-forest);
  color: var(--lf-cream);
  font-family: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  overflow: auto;
  overscroll-behavior: contain;
}
.lead-form::backdrop { background: rgba(8, 11, 7, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.lead-form[open] { animation: lfIn 420ms var(--lf-ease); }
.lead-form[open]::backdrop { animation: lfFade 300ms ease; }
@keyframes lfIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes lfFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lead-form[open], .lead-form[open]::backdrop { animation: none; }
}

html.lead-form-open, html.lead-form-open body { overflow: hidden; }

.lead-form *, .lead-form *::before, .lead-form *::after { box-sizing: border-box; }

.lead-form__inner { position: relative; display: grid; gap: 20px; padding: 32px 28px 26px; }
.lead-form__inner::before {
  content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--lf-gold-light), transparent);
}

.lead-form__close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--lf-line); background: transparent; color: var(--lf-cream);
  cursor: pointer; transition: border-color 200ms ease;
}
.lead-form__close:hover, .lead-form__close:focus-visible { border-color: var(--lf-gold-light); }
.lead-form__close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }

.lead-form__title { margin: 0; padding-right: 44px; font-family: inherit; font-size: 1.3rem; font-weight: 400; line-height: 1.3; letter-spacing: -0.015em; color: #fff; text-wrap: balance; }

.lead-form__form { display: grid; gap: 14px; margin: 0; }

.lead-form__field { position: relative; }

/* Label só para leitores de tela / autofill — o texto visível é o placeholder */
.lead-form__sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.lead-form__input {
  width: 100%; min-height: 50px; padding: 12px 16px;
  border: 1px solid var(--lf-line); border-radius: 12px;
  background: rgba(242, 233, 222, 0.05); color: #fff;
  font-family: inherit; font-size: 16px; /* 16px evita o zoom automático do iOS */
  transition: border-color 200ms ease, background-color 200ms ease;
}
.lead-form__input::placeholder { color: rgba(242, 233, 222, 0.5); }
.lead-form__input:focus { outline: none; border-color: var(--lf-gold-light); background: rgba(242, 233, 222, 0.08); }
/* Erros DENTRO do campo:
   vazio → a mensagem vira o placeholder, em vermelho;
   preenchido → aviso curto no canto direito do campo. */
.lead-form__input.is-invalid { border-color: var(--lf-error); }
.lead-form__input.is-invalid::placeholder { color: var(--lf-error); opacity: 1; }
.lead-form__input.has-inline-error { padding-right: 150px; }

.lead-form__error {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.lead-form__error.is-inline {
  width: auto; height: auto; clip: auto; overflow: visible;
  top: 50%; right: 16px; transform: translateY(-50%);
  font-size: 0.75rem; font-weight: 500; color: var(--lf-error);
  pointer-events: none;
}

/* Honeypot — fora da tela para humanos, visível para robôs */
.lead-form__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.lead-form__submit {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; margin-top: 6px; padding: 14px 24px;
  border: 0; border-radius: 999px;
  background: var(--lf-cream); color: var(--lf-forest);
  font-family: inherit; font-size: 1rem; font-weight: 500;
  cursor: pointer; overflow: hidden; isolation: isolate;
  transition: transform 300ms var(--lf-ease), box-shadow 300ms var(--lf-ease);
}
.lead-form__submit::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: linear-gradient(135deg, var(--lf-gold-light), var(--lf-gold) 50%, var(--lf-gold-deep));
  transition: opacity 300ms var(--lf-ease);
}
.lead-form__submit:hover, .lead-form__submit:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 40px -14px rgba(201, 160, 99, 0.5); }
.lead-form__submit:hover::before, .lead-form__submit:focus-visible::before { opacity: 1; }
.lead-form__submit:focus-visible { outline: 2px solid var(--lf-gold-light); outline-offset: 3px; }
.lead-form__submit svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lead-form__submit[disabled] { opacity: 0.7; pointer-events: none; }

.lead-form__legal { margin: 0; font-size: 0.72rem; font-weight: 300; line-height: 1.55; color: rgba(242, 233, 222, 0.55); text-align: center; }
.lead-form__legal a { color: var(--lf-gold-light); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 420px) {
  .lead-form__inner { padding: 28px 20px 22px; }
  .lead-form__title { font-size: 1.18rem; }
}

/* ============================================
   VARIANTE FIXA NA PÁGINA (.lead-form--inline) — formulário da hero da
   /fpr-v2/. Mesmo visual do popup, sem comportamento de <dialog>.
   ============================================ */

.lead-form--inline {
  width: 100%;
  max-height: none;
  margin: 0;
  overflow: visible;
  border-radius: 18px;
  background: rgba(20, 26, 18, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
}
.lead-form--inline .lead-form__form { position: relative; padding: 22px 22px 18px; gap: 12px; }
.lead-form--inline .lead-form__form::before {
  content: ""; position: absolute; top: 0; left: 22px; right: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--lf-gold-light), transparent);
}
.lead-form--inline .lead-form__title { padding-right: 0; font-size: 1rem; font-weight: 400; color: rgba(255, 255, 255, 0.92); }
.lead-form--inline .lead-form__submit { margin-top: 2px; }

/* Desktop: 2 colunas — Nome | WhatsApp / E-mail | Botão */
@media (min-width: 1024px) {
  .lead-form--inline .lead-form__form { grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .lead-form--inline .lead-form__title,
  .lead-form--inline .lead-form__legal { grid-column: 1 / -1; }
  .lead-form--inline .lead-form__submit { margin-top: 0; min-height: 50px; font-size: 0.95rem; }
  .lead-form--inline .lead-form__legal { text-align: left; }
}

@media (max-width: 420px) {
  .lead-form--inline .lead-form__form { padding: 18px 16px 14px; gap: 10px; }
  .lead-form--inline .lead-form__input { min-height: 48px; }
}
