/* ==========================================================================
   Diagnóstico de marca · experiência de captação (mobile first)
   Usa os mesmos tokens, fontes, botões e formas da Home.
   ========================================================================== */

.diag-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Formas da identidade ao fundo */
.diag-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.diag-bg img { position: absolute; height: auto; user-select: none; }
.diag-bg__triangle { width: 360px; right: -170px; top: -120px; opacity: 0.85; }
.diag-bg__ellipse { width: 420px; left: -260px; bottom: -150px; opacity: 0.8; }

.diag {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Barra de progresso */
.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 4px;
  background: var(--c-cream-10);
  z-index: 20;
}
.progress__bar {
  height: 100%;
  background: var(--c-red);
  transform-origin: left center;
  transform: scaleX(0.03);
  transition: transform 0.5s var(--ease);
}

/* Topo */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: calc(14px + env(safe-area-inset-top)) 12px 10px;
  transition: background-color 0.2s var(--ease);
}
.topbar.is-scrolled {
  background: rgb(25 25 25 / 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.topbar__logo { grid-column: 2; justify-self: center; width: 132px; height: auto; }
.topbar__count {
  grid-column: 3;
  justify-self: end;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--c-cream-70);
}
.icon-btn {
  grid-column: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--c-cream-20);
  background: rgb(47 45 45 / 0.6);
  color: var(--c-cream);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--c-cream); }
.icon-btn[hidden] { display: grid; visibility: hidden; }

/* Palco */
.stage {
  position: relative;
  flex: 1;
  display: grid;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 20px calc(40px + env(safe-area-inset-bottom));
}
.step {
  grid-area: 1 / 1;
  align-self: start;
  width: 100%;
}
.step.is-leaving { pointer-events: none; }

/* Transições */
@keyframes step-in-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes step-in-down { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: none; } }
@keyframes step-out-up { to { opacity: 0; transform: translateY(-28px); } }
@keyframes step-out-down { to { opacity: 0; transform: translateY(28px); } }
.step.is-entering.from-bottom { animation: step-in-up 0.42s var(--ease) both; animation-delay: 0.06s; }
.step.is-entering.from-top { animation: step-in-down 0.42s var(--ease) both; animation-delay: 0.06s; }
.step.is-leaving.to-top { animation: step-out-up 0.26s ease-in both; }
.step.is-leaving.to-bottom { animation: step-out-down 0.26s ease-in both; }

/* Cabeçalho da pergunta */
.step__eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-cream-70);
}
.step__num { color: var(--c-red); font-weight: 600; letter-spacing: 0.08em; }
.step__title {
  margin-top: 10px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(25px, 6.4vw, 40px);
  line-height: 1.16;
  letter-spacing: -0.005em;
  color: var(--c-cream);
  outline: none;
  text-wrap: balance;
}
.step__title .hand { font-size: 1.14em; line-height: 1; }
.step__hint {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--c-cream-70);
  max-width: 560px;
}

/* Alternativas */
.options {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 10px 44px 10px 14px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--c-cream);
  background: rgb(47 45 45 / 0.62);
  border: 1px solid var(--c-cream-20);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), transform 0.18s var(--ease), color 0.18s var(--ease);
}
.option__key {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--c-cream-50);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: inherit;
}
.option__check {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s var(--ease), transform 0.25s var(--ease);
}
@media (hover: hover) {
  .option:hover { border-color: var(--c-cream-70); background: rgb(61 60 60 / 0.75); }
}
.option:active { transform: scale(0.985); }
.option:focus-visible { outline: 2px solid var(--c-cream); outline-offset: 3px; }
.option[aria-checked='true'] {
  background: var(--c-red);
  border-color: var(--c-red);
  color: var(--c-white);
}
.option[aria-checked='true'] .option__key { background: var(--c-cream); border-color: var(--c-cream); color: var(--c-red); }
.option[aria-checked='true'] .option__check { opacity: 1; transform: none; }
@keyframes picked { 0%, 100% { opacity: 1; } 35% { opacity: 0.55; } 70% { opacity: 1; } }
.option.is-picked { animation: picked 0.34s ease-out; }

/* Campo opcional ("Outro", "Indicação") */
.detail { margin-top: 16px; }
.detail__label { display: block; font-size: 15px; color: var(--c-cream-70); margin-bottom: 8px; }

/* Ações */
.step__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}
.step__actions[hidden] { display: none; }
.step__continue { min-width: 180px; }
.enter-hint { font-size: 14px; color: var(--c-cream-70); }
.enter-hint kbd { font: inherit; font-weight: 600; color: var(--c-cream); }

/* Campos */
.field__label { display: block; font-size: 15px; font-weight: 500; margin-bottom: 8px; color: var(--c-cream); }
.field__opt { color: var(--c-cream-50); font-weight: 400; }
.field__input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  font-size: 17px; /* ≥16px evita zoom automático no iOS */
  color: var(--c-cream);
  background: rgb(47 45 45 / 0.72);
  border: 1px solid var(--c-cream-20);
  border-radius: 10px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  appearance: none;
}
.field__input::placeholder { color: rgb(242 228 218 / 0.35); }
.field__input:focus { border-color: var(--c-cream); box-shadow: 0 0 0 3px rgb(231 47 32 / 0.45); }
.has-error .field__input { border-color: var(--c-error-on-dark); }
.field__help { margin-top: 6px; font-size: 13px; color: var(--c-cream-50); }
.field__error,
.form-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--c-error-on-dark);
}
.field__error[hidden], .form-error[hidden], .field__suggest[hidden] { display: none; }
.field__error svg, .form-error svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.field__suggest { margin-top: 6px; font-size: 14px; color: var(--c-cream-70); }
.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-cream);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.phone { display: flex; }
.phone__prefix {
  flex: none;
  min-width: 64px;
  padding: 0 12px;
  border: 1px solid var(--c-cream-20);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: rgb(61 60 60 / 0.8);
  color: var(--c-cream);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.phone__prefix:hover { background: rgb(80 78 78 / 0.9); }
.phone__input { border-radius: 0 10px 10px 0; }

.contact { margin-top: 24px; }
.contact__grid { display: grid; gap: 18px; }
.contact__submit { margin-top: 26px; }
.form-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgb(255 138 126 / 0.5);
  border-radius: 10px;
  background: rgb(231 47 32 / 0.12);
}
.contact__btn { width: 100%; position: relative; }
.contact__btn:disabled { cursor: progress; opacity: 0.9; }
.contact__privacy { margin-top: 12px; font-size: 13px; line-height: 1.4; color: var(--c-cream-50); text-align: center; }

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgb(255 255 255 / 0.35);
  border-top-color: var(--c-white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Campo-isca anti-robô */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Tela final */
.step--done { text-align: center; padding-top: 12px; }
.step--done .step__hint { margin-inline: auto; }
.done__icon { width: 84px; height: 84px; margin: 0 auto 22px; }
.done__icon svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.done__ring { stroke: var(--c-red); stroke-width: 3; stroke-dasharray: 252; stroke-dashoffset: 252; animation: draw 0.7s var(--ease) 0.1s forwards; }
.done__check { stroke: var(--c-cream); stroke-width: 4; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.45s var(--ease) 0.65s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.recap {
  margin: 28px auto 0;
  max-width: 520px;
  text-align: left;
  background: rgb(47 45 45 / 0.62);
  border: 1px solid var(--c-cream-20);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 6px 18px;
}
.recap div { padding: 12px 0; }
.recap div + div { border-top: 1px solid var(--c-cream-20); }
.recap dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-cream-50); }
.recap dd { margin: 4px 0 0; font-size: 16px; }
.done__actions { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 30px; }
.done__actions .btn { min-width: 240px; }
.done__link { font-size: 15px; color: var(--c-cream-70); text-underline-offset: 3px; }
.done__link:hover { color: var(--c-cream); }

/* ==========================================================================
   Telas maiores
   ========================================================================== */
@media (min-width: 720px) {
  .diag-bg__triangle { width: 620px; right: -200px; top: -160px; }
  .diag-bg__ellipse { width: 720px; left: -380px; bottom: -220px; }
  .topbar { padding: 22px 32px 14px; grid-template-columns: 48px 1fr 48px; }
  .topbar__logo { width: 160px; }
  .stage { padding: 6vh 32px 64px; }
  .step { align-self: center; }
  .step--done { align-self: center; }
  .step__hint { font-size: 18px; }
  .options { margin-top: 32px; gap: 12px; }
  .options--grid { grid-template-columns: 1fr 1fr; }
  .option { min-height: 64px; font-size: 17px; }
  .contact__grid { grid-template-columns: 1fr 1fr; gap: 20px 18px; }
  .contact__btn { width: auto; min-width: 260px; }
  .contact__privacy { text-align: left; }
  .contact__submit { display: flex; flex-direction: column; align-items: flex-start; }
}

@media (min-width: 720px) and (max-height: 760px) {
  .stage { padding-top: 24px; }
  .step { align-self: start; }
  .option { min-height: 56px; }
}

/* Telas muito pequenas (ex.: iPhone SE) */
@media (max-width: 360px) {
  .stage { padding-inline: 16px; }
  .option { font-size: 16px; gap: 10px; padding-left: 12px; }
  .option__key { width: 24px; height: 24px; font-size: 12px; }
}
