/* ============================================================
   /diagnostico — wizard (mobile primeiro)
   ============================================================ */
.pg-diag { min-height: 100svh; display: flex; flex-direction: column; }
.diag-topo { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.diag-contador { font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.diag-contador [data-atual] { color: var(--text); font-weight: 600; }

.diag-progresso { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.diag-progresso span { position: relative; display: block; height: 100%; width: 12.5%; border-radius: inherit; overflow: hidden; background: linear-gradient(90deg, var(--accent), #6CC7F5); transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1); }
/* onda de luz: corre uma vez a cada passo avançado */
.diag-progresso span::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: translateX(-100%); }
.diag-progresso.pulsa span::after { animation: onda-luz 0.9s ease-out; }
@keyframes onda-luz { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.diag-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: 28px 32px; }
.wizard { position: relative; padding: clamp(22px, 4vw, 48px); max-width: 860px; width: 100%; margin-inline: auto; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.passo { border: 0; margin: 0; padding: 0; min-width: 0; }
.passo { transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.passo.entrando { animation: passo-entra 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
.passo.entrando.para-tras { animation-name: passo-volta; }
.passo.saindo { opacity: 0; transform: translateX(-20px); }
.passo.saindo-tras { opacity: 0; transform: translateX(20px); }
@keyframes passo-entra { from { opacity: 0; transform: translateX(20px); } }
@keyframes passo-volta { from { opacity: 0; transform: translateX(-20px); } }
.passo legend { font: 700 clamp(1.35rem, 3.6vw, 2rem)/1.2 var(--font-display); letter-spacing: -0.02em; margin-bottom: 10px; padding: 0; }
.p-num { display: block; font: 600 0.8rem var(--font-body); letter-spacing: 0.14em; color: var(--cyan); margin-bottom: 10px; }
.p-ajuda { color: var(--text-2); margin-bottom: 22px; }
.passo legend + .opcoes, .passo legend + .campos-grid, .passo legend + .resumo { margin-top: 22px; }

/* ---------- opções (cards selecionáveis) ---------- */
.opcoes { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
  .grade-3 { grid-template-columns: repeat(3, 1fr); }
  .grade-4 { grid-template-columns: repeat(4, 1fr); }
  .grade-5 { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 340px) { .opcoes:not(.compacta) { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .opcao > span { min-height: 70px; padding: 12px 14px; font-size: 0.93rem; }
  .grade-5 .opcao:last-child { grid-column: 1 / -1; }
  .opcoes { gap: 10px; }
}
.opcao { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.opcao input { position: absolute; opacity: 0; pointer-events: none; }
.opcao > span {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px;
  min-height: 84px; height: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 0.97rem; font-weight: 500; line-height: 1.3;
  transition: border-color 0.25s, background 0.25s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.opcao i { font-style: normal; font-size: 1.4rem; line-height: 1; }
.opcao b { font: 700 1.35rem var(--font-display); color: var(--text); }
.compacta .opcao > span { min-height: 52px; align-items: center; }
.opcao:hover > span { border-color: var(--accent); }
.opcao input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 3px; }
.opcao input:checked + span {
  border-color: var(--cyan);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--accent);
}
.opcao input:checked + span::after {
  content: ''; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 13px no-repeat;
  animation: marca 0.35s var(--ease);
}
@keyframes marca { from { transform: scale(0); } }

/* ---------- campos ---------- */
.campo { margin-top: 18px; display: grid; gap: 8px; }
.campo label, .rotulo { font-size: 0.92rem; font-weight: 500; color: var(--text-2); }
.campos-grid { display: grid; gap: 4px 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .campos-grid { grid-template-columns: 1fr 1fr; } }
input[type='text'], input[type='tel'], input[type='email'], input[type='url'], textarea {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--input-bg);
  color: var(--text);
  font: 400 1rem var(--font-body); /* 16px: evita zoom automático no iOS */
  transition: border-color 0.25s, box-shadow 0.25s;
}
textarea { resize: vertical; min-height: 150px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--line-2); }
.invalido { border-color: var(--coral) !important; box-shadow: 0 0 0 2px var(--coral) !important; }
.contador { justify-self: end; font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.contador.quase { color: var(--amber); }
.contador.cheio { color: var(--danger); }

/* ---------- final ---------- */
.resumo { display: grid; gap: 8px; padding: 18px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); margin-bottom: 20px; font-size: 0.94rem; }
.resumo div { display: flex; justify-content: space-between; gap: 16px; }
.resumo dt, .resumo .k { color: var(--muted); }
.resumo .v { text-align: right; color: var(--text); }
.consentimento { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; color: var(--text-2); font-size: 0.95rem; }
.consentimento input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--cyan); }
.turnstile-caixa { margin-top: 22px; min-height: 65px; }

/* ---------- navegação ---------- */
.erro-msg { margin: 20px 0 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--bg); border: 1.5px solid var(--coral); color: var(--text); font-size: 0.95rem; }
.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; }
.wizard-nav [data-voltar][disabled] { visibility: hidden; }
.wizard-nav .btn-primary { animation: none; margin-left: auto; }
@media (max-width: 560px) {
  .wizard-nav { position: sticky; bottom: 0; margin-inline: calc(-1 * clamp(22px, 4vw, 48px)); margin-bottom: calc(-1 * clamp(22px, 4vw, 48px)); padding: 14px clamp(22px, 4vw, 48px) calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
  .wizard-nav .btn { padding: 14px 18px; }
  .wizard-nav .btn-primary { flex: 1; }
}
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-top-color: transparent; animation: gira 0.8s linear infinite; }
.enviando .spinner { display: inline-block; }
.enviando .txt { opacity: 0.7; }
@keyframes gira { to { transform: rotate(360deg); } }
.diag-rodape { text-align: center; color: var(--muted); font-size: 0.92rem; margin: 22px 0 0; }

.campo-largo { grid-column: 1 / -1; }
.opcional { font-weight: 400; color: var(--muted); }
.opcao > span { min-height: 64px; }
@media (prefers-reduced-motion: reduce) { .diag-progresso.pulsa span::after { animation: none; } }
.resumo .k { white-space: nowrap; flex: none; }
