.app-back { color: var(--acid); font-size: .875rem; display: inline-flex; align-items: center; gap: .3rem; min-height: 2.75rem; }
.app-back span { font-size: 1.4em; line-height: 1; }
.app-back:hover { text-decoration: underline; text-underline-offset: 3px; }

.app {
  position: relative;
  max-width: calc(var(--max) + 2 * var(--pad));
  margin: 0 auto;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  padding: calc(var(--header) + clamp(3rem, 8vh, 5.5rem)) var(--pad) 5rem;
}
.app::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: min(60rem, 100%);
  height: 40rem;
  background: radial-gradient(closest-side, rgba(255, 107, 26, .12), transparent);
  pointer-events: none;
  z-index: -1;
}

.app-intro { align-self: start; position: sticky; top: calc(var(--header) + 3rem); }
.app-intro h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.6rem, 4.6vw, 4rem); line-height: 1.05; letter-spacing: -.035em; margin: .75rem 0 1.25rem; }
.app-intro h1 span { color: var(--acid); }
.app-intro > p { color: var(--muted); max-width: 26rem; font-size: 1.125rem; line-height: 1.45; margin: 0; }
.app-facts { list-style: none; padding: 0; margin: 2.5rem 0 0; display: flex; gap: .75rem; }
.app-facts li { display: flex; flex-direction: column; gap: .15rem; background: var(--surface); border-radius: var(--radius-sm); padding: 1rem 1.25rem; min-width: 9rem; }
.app-facts b { font-family: var(--display); font-weight: 600; font-size: 1.4rem; letter-spacing: -.025em; }
.app-facts span { color: var(--muted); font-size: .8rem; }

/* Cartão do formulário — estilo sheet do iOS */
.app-card { align-self: start; position: relative; background: var(--surface); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 3rem); overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); }
.app-progress { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: rgba(255, 255, 255, .06); }
.app-progress span { display: block; height: 100%; width: 25%; background: var(--acid); border-radius: 0 4px 4px 0; transition: width .5s var(--ease); }
.app-step-count { font-size: .8rem; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.app-step-count #step-current { color: var(--acid); }

.app-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.step { display: none; border: 0; padding: 0; margin: 0; min-width: 0; }
.step.active { display: block; animation: step-in .5s var(--ease); }
.step legend { font-family: var(--display); font-weight: 600; font-size: clamp(1.75rem, 3vw, 2.4rem); letter-spacing: -.03em; line-height: 1.1; padding: 0; margin: .75rem 0 2rem; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1rem; margin-bottom: 1.5rem; }
.field { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.75rem; }
.field-grid .field { margin-bottom: 0; }
.field > span { font-size: .875rem; font-weight: 500; color: var(--muted); }
.field > span em { font-style: normal; font-weight: 400; color: var(--faint); }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: .85rem 1rem;
  font: inherit;
  font-size: 1.0625rem;
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 7rem; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.3rem) 52%, calc(100% - .95rem) 52%;
  background-size: .35rem .35rem;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}
.field select option { background: var(--surface-2); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:hover, .field select:hover, .field textarea:hover { background-color: #242426; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acid); box-shadow: 0 0 0 4px var(--acid-soft); background-color: var(--surface-2); }
.field .invalid { border-color: #ff453a; }
.chips.invalid label span, .options.invalid label > span { box-shadow: inset 0 0 0 1px #ff453a; }

/* Opções em pílula, como os seletores do iOS */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips label, .options label { cursor: pointer; }
.chips input, .options input { position: absolute; opacity: 0; pointer-events: none; }
.chips label span { display: inline-flex; align-items: center; min-height: 2.5rem; background: var(--surface-2); border-radius: 980px; padding: .5rem 1rem; font-size: .9375rem; transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease); }
.chips label:hover span { background: #2c2c2e; }
.chips label:active span { transform: scale(.97); }
.chips input:checked + span { background: var(--acid); color: #000; font-weight: 500; }
.chips input:focus-visible + span, .options input:focus-visible + span { outline: 2px solid var(--acid); outline-offset: 2px; }

.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .6rem; }
.options label > span { display: flex; flex-direction: column; gap: .25rem; height: 100%; background: var(--surface-2); border-radius: 16px; padding: 1rem 1.1rem; color: var(--muted); font-size: .875rem; line-height: 1.35; transition: background .2s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease); }
.options label > span b { font-family: var(--display); font-weight: 600; font-size: 1.0625rem; color: var(--text); letter-spacing: -.02em; }
.options label:hover > span { background: #242426; }
.options label:active > span { transform: scale(.98); }
.options input:checked + span { background: var(--acid-soft); box-shadow: inset 0 0 0 2px var(--acid); }
.options input:checked + span b { color: var(--acid); }

.consent { display: flex; gap: .75rem; align-items: flex-start; color: var(--muted); font-size: .875rem; cursor: pointer; }
.consent input { accent-color: var(--acid); width: 1.25rem; height: 1.25rem; margin-top: .05rem; flex: none; }
.consent.invalid { color: #ff6961; }

.app-error { min-height: 1.5rem; color: #ff6961; font-size: .9rem; margin: 1rem 0 0; }

.app-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.app-actions button { font: inherit; cursor: pointer; border-radius: 980px; transition: background .2s var(--ease), transform .2s var(--ease); }
.app-prev { background: none; border: 0; color: var(--acid); padding: .6rem 0; min-height: 2.75rem; display: inline-flex; align-items: center; gap: .3rem; }
.app-prev span { font-size: 1.4em; line-height: 1; }
.app-prev:hover { text-decoration: underline; text-underline-offset: 3px; }
.app-prev[hidden] { display: inline-flex; visibility: hidden; }
.app-next, .app-submit { margin-left: auto; background: var(--acid); color: #000; border: 0; min-height: 2.75rem; padding: .75rem 1.6rem; font-size: 1.0625rem; font-weight: 500; }
.app-next:hover, .app-submit:hover { background: var(--acid-hover); }
.app-next:active, .app-submit:active { transform: scale(.97); }
.app-next[hidden], .app-submit[hidden] { display: none; }
.app-submit[disabled] { opacity: .5; cursor: wait; }

.app-done { padding: 1.5rem 0 .5rem; }
.app-done .contact-kicker { color: var(--muted); }
.app-done .pulse { background: var(--acid); box-shadow: 0 0 0 0 rgba(255, 107, 26, .45); }
.app-done h2 { font-family: var(--display); font-weight: 600; font-size: clamp(2.4rem, 4.4vw, 3.6rem); line-height: 1.05; letter-spacing: -.035em; margin: 1.25rem 0 1rem; }
.app-done h2 span { color: var(--acid); }
.app-done p { color: var(--muted); max-width: 28rem; margin: 0 0 2rem; font-size: 1.0625rem; }
.app-whatsapp { display: inline-flex; align-items: center; min-height: 2.75rem; background: var(--acid); color: #000; border-radius: 980px; padding: .75rem 1.6rem; font-size: 1.0625rem; font-weight: 500; transition: background .2s var(--ease); }
.app-whatsapp:hover { background: var(--acid-hover); }

@keyframes step-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; gap: 2.5rem; }
  .app-intro { position: static; }
}
@media (max-width: 560px) {
  .field-grid { grid-template-columns: 1fr; }
  .options { grid-template-columns: 1fr; }
  .app-card { border-radius: 22px; padding: 1.5rem 1.25rem; }
  .app-facts li { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .step.active { animation: none; }
}
