/* =========================================================================
   /analise - formulario de qualificacao
   Reusa os tokens/identidade de ../styles.css (creme, terracota, carvao,
   Sora/Inter, botoes, raio). Aqui vao apenas estilos especificos do form.
   ========================================================================= */

/* o atributo hidden precisa vencer os displays definidos em .btn/.an-step/etc. */
[hidden] { display: none !important; }

.analise {
  background: var(--bg);
  min-height: 100vh;
  padding: clamp(26px, 5vw, 60px) 0 clamp(40px, 6vw, 80px);
}
.an-wrap { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 20px; }

/* ---- cabecalho ---- */
.an-head { text-align: center; margin-bottom: clamp(22px, 3vw, 32px); }
.an-head h1 { font-size: clamp(1.9rem, 4.6vw, 2.6rem); line-height: 1.08; margin: 6px 0 12px; }
.an-head .lead { max-width: 520px; margin: 0 auto; }

/* ---- progresso ---- */
.an-progress { margin: clamp(20px, 3vw, 28px) auto 0; max-width: 420px; }
.an-progress-bar { height: 5px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.an-progress-bar span { display: block; height: 100%; width: 20%; background: var(--terra); border-radius: 99px; transition: width .35s var(--ease); }
.an-progress-tx { margin-top: 9px; font-size: .82rem; font-weight: 600; letter-spacing: .04em; color: var(--ink-2); text-transform: uppercase; }

/* ---- card do formulario ---- */
.an-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(22px, 4vw, 40px);
  box-shadow: 0 1px 2px rgba(36,29,26,.03), 0 18px 40px -26px rgba(36,29,26,.20);
}

/* ---- passos ---- */
.an-step { border: 0; padding: 0; margin: 0; }
.an-step[hidden] { display: none; }
.an-step legend { display: block; width: 100%; padding: 0; margin: 0 0 4px; }
.an-step-title { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); letter-spacing: -.01em; }
.an-step-sub { color: var(--ink-2); font-size: .96rem; margin: 4px 0 20px; }

.an-field { margin-bottom: 18px; }
.an-field:last-child { margin-bottom: 0; }
.an-label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 8px; font-size: 1rem; }
.an-hint { display: block; font-weight: 400; color: var(--ink-2); font-size: .88rem; margin-top: 2px; }

/* ---- inputs texto ---- */
.an-input, .an-textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--bg-lite);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 13px 14px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.an-textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.an-input::placeholder, .an-textarea::placeholder { color: var(--ink-3); }
.an-input:focus, .an-textarea:focus {
  outline: none; border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(168,71,50,.15);
}
.an-input[aria-invalid="true"], .an-textarea[aria-invalid="true"] { border-color: var(--terra-d); }

/* WhatsApp com prefixo fixo +55 */
.an-tel { display: flex; align-items: stretch; }
.an-tel-prefix {
  display: flex; align-items: center; padding: 0 13px; white-space: nowrap;
  background: var(--bg-alt); color: var(--ink-2); font-weight: 700; font-size: .95rem;
  border: 1px solid var(--line); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.an-tel-input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.an-tel:focus-within .an-tel-prefix { border-color: var(--terra); }

.an-counter { text-align: right; font-size: .8rem; color: var(--ink-2); margin-top: 5px; }
.an-min-hint { color: var(--terra-d); font-weight: 600; }
.an-counter.is-under { color: var(--terra-d); }

/* ---- opcoes (radio / checkbox) como itens clicaveis ---- */
.an-options { display: grid; gap: 10px; }
.an-option {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 15px; cursor: pointer; background: var(--bg-lite);
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.an-option:hover { border-color: var(--sand); }
.an-option input { margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--terra); flex: none; }
.an-option .an-option-tx { color: var(--ink); font-size: .98rem; line-height: 1.4; }
.an-option:has(input:checked) { border-color: var(--terra); background: var(--terra-wash); }
.an-option.is-checked { border-color: var(--terra); background: var(--terra-wash); } /* fallback sem :has */

.an-conditional { margin-top: 12px; }
.an-conditional[hidden] { display: none; }

/* ---- erros ---- */
.an-err { color: var(--terra-d); font-size: .86rem; font-weight: 600; margin-top: 7px; min-height: 0; }
.an-err:empty { display: none; }

/* ---- navegacao ---- */
.an-nav { display: flex; gap: 12px; margin-top: 26px; align-items: center; }
.an-nav .btn { flex: 1; }
.btn-ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink-2); background: var(--bg); }
.btn[disabled] { opacity: .6; cursor: default; pointer-events: none; }
.an-back[hidden] { display: none; }

/* ---- consentimento ---- */
.an-consent { display: flex; align-items: flex-start; gap: 12px; margin-top: 4px; }
.an-consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--terra); flex: none; }
.an-consent label { color: var(--ink-2); font-size: .92rem; line-height: 1.5; }
.an-consent a { color: var(--terra); text-decoration: underline; }

/* ---- honeypot (fora da tela) ---- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- tela final ---- */
.an-result { text-align: center; padding: clamp(10px, 3vw, 24px) 0; }
.an-result .eyebrow { justify-content: center; }
.an-result h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 6px 0 14px; }
.an-result p { color: var(--ink-2); max-width: 520px; margin: 0 auto 12px; font-size: 1.05rem; line-height: 1.6; }
.an-result .an-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.an-result .an-actions .btn { min-width: 260px; }

/* estado de carregamento */
.an-loading .btn-cta { pointer-events: none; opacity: .75; }

@media (max-width: 560px) {
  .an-nav { flex-direction: column-reverse; }
  .an-nav .btn { width: 100%; flex: none; }
  .an-result .an-actions .btn { width: 100%; min-width: 0; }
}
