:root {
  color-scheme: light; font-family: Arial, sans-serif; color: #24342c; background: #fff;
  --yes: #146c35; --yes-line: #35b86a; --yes-soft: #effbf3; --yes-fill: #15803d;
  --no: #a11a1a; --no-line: #ec5b5b; --no-soft: #fff2f2; --no-fill: #dc2626;
  --arrow: #6f7d75;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
main { width: 100%; max-width: 720px; margin: 0 auto; padding: 28px 26px 24px; }
form { display: flex; flex-direction: column; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field + .field { margin-top: 20px; }
.question-label { display: block; width: 100%; font-size: clamp(18px, 2.9vw, 22px); line-height: 1.48; font-weight: 600; margin: 0 0 20px; overflow-wrap: anywhere; }
.field-text .question-label { font-size: 17px; margin-bottom: 8px; }
.question-label div:first-child:not(:last-child) { font-weight: 400; }
.question-label p:empty { display: none; }

/* Respostas: Sim (verde) e Não (vermelho) lado a lado; outras escolhas empilhadas. */
.choices { display: grid; gap: 12px; }
.choices.yesno { grid-template-columns: 1fr 1fr; }
.choice {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 12px 16px;
  border: 2px solid #9eaea4; border-radius: 14px; background: #fff;
  cursor: pointer; font-size: 18px; line-height: 1.3;
  -webkit-tap-highlight-color: transparent; user-select: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.choice:hover { background: #f4f8f5; }
.choice:active { transform: scale(.98); }
.choice.is-checked { border-color: #164c34; background: #edf5ef; font-weight: 700; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.choice:has(input:focus-visible) { outline: 3px solid #b6790c; outline-offset: 3px; }
@supports not selector(:has(*)) {
  .choice:focus-within { outline: 3px solid #b6790c; outline-offset: 3px; }
}
.choice-mark { flex: 0 0 auto; font-size: 1.1em; line-height: 1; }
.yesno .choice { justify-content: center; min-height: 64px; padding: 12px 10px; font-size: 19px; font-weight: 700; }
.choice.yes { border-color: var(--yes-line); background: var(--yes-soft); color: var(--yes); }
.choice.yes:hover { background: #def6e6; }
.choice.yes.is-checked { border-color: var(--yes-fill); background: var(--yes-fill); color: #fff; }
.choice.no { border-color: var(--no-line); background: var(--no-soft); color: var(--no); }
.choice.no:hover { background: #ffe3e3; }
.choice.no.is-checked { border-color: var(--no-fill); background: var(--no-fill); color: #fff; }

input[type=text], input[type=tel] { display: block; width: 100%; min-height: 54px; padding: 12px 14px; border: 1px solid #84998c; border-radius: 12px; font: inherit; font-size: 18px; background: white; color: #17271d; }
input[aria-invalid="true"] { border-color: #9a1717; }
:focus-visible { outline: 3px solid #b6790c; outline-offset: 4px; }
.field-error { font-size: 16px; line-height: 1.45; color: #9a1717; margin: 8px 0 0; }

/* Navegação: setas discretas; no último passo, Voltar à esquerda e o botão de envio à direita. */
nav { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
nav .arrow {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 48px; height: 48px; min-height: 0; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--arrow);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
nav .arrow svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
nav .arrow:hover { color: #24342c; background: rgba(0, 0, 0, .04); }
#next { margin-left: auto; }
nav .cta {
  position: relative; overflow: hidden; flex: 1 1 auto; min-width: 0;
  min-height: 56px; margin: 0 0 0 auto; padding: 12px 16px;
  border: 0; border-radius: 14px;
  background: linear-gradient(180deg, #2bd46c 0%, #1fbe5c 45%, #128c4a 100%);
  color: #fff; font: inherit; font-size: 17px; font-weight: 800; line-height: 1.15;
  letter-spacing: .02em; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
  box-shadow: 0 6px 18px rgba(37, 211, 102, .45);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  animation: cta-glow 2s ease-in-out infinite;
}
nav .cta::after {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: -60%; width: 45%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .6) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg); pointer-events: none;
  animation: cta-shine 2.8s ease-in-out infinite;
}
nav .cta:hover { filter: brightness(1.05); }
nav .cta:active { transform: scale(.98); }
@keyframes cta-shine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@keyframes cta-glow {
  0%, 100% { box-shadow: 0 6px 18px rgba(37, 211, 102, .45), 0 0 0 0 rgba(37, 211, 102, .55); }
  50% { box-shadow: 0 6px 22px rgba(37, 211, 102, .6), 0 0 0 8px rgba(37, 211, 102, 0); }
}
button:disabled { opacity: .55; cursor: wait; }
nav .cta:disabled, nav .cta:disabled::after { animation: none; }

/* Botões dos estados de recuperação (resultado/recibo). */
#result button { min-height: 48px; padding: 12px 22px; border: 1px solid #164c34; border-radius: 7px; font: inherit; font-weight: 600; font-size: 17px; color: #164c34; background: #fff; cursor: pointer; }
[hidden] { display: none !important; }
#error { font-size: 16px; line-height: 1.45; color: #9a1717; margin: 16px 0 0; }
#result { padding: 32px 4px; font-size: 19px; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 440px) {
  main { padding: 20px 16px; }
  .question-label { font-size: 18px; }
  .field-text .question-label { font-size: 17px; }
  nav .cta { font-size: 16px; letter-spacing: 0; padding: 12px; }
}
@media (max-width: 340px) {
  .yesno .choice { font-size: 17px; min-height: 58px; }
  nav .cta { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
