.questionflow-screen {
  padding: 0;
}

.vitalyx-questionflow {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  background: var(--vitalyx-surface-canvas, var(--bg));
  color: var(--vitalyx-text-primary, var(--ink));
  font-family: var(--vitalyx-font-body, inherit);
}

.vitalyx-questionflow__header {
  padding: var(--vitalyx-space-4, 1rem) var(--vitalyx-space-6, 1.5rem)
    var(--vitalyx-space-3, 0.75rem);
  border-bottom: 1px solid var(--vitalyx-border-subtle, var(--line));
  background: var(--vitalyx-surface-raised, var(--card));
}

.vitalyx-questionflow__eyebrow {
  margin: 0;
  color: var(--vitalyx-action-primary, var(--em));
  font-family: var(--vitalyx-font-meta, ui-monospace, monospace);
  font-size: var(--vitalyx-type-eyebrow, 0.6875rem);
  font-weight: 600;
  letter-spacing: var(--vitalyx-tracking-eyebrow, 0.12em);
  line-height: var(--vitalyx-leading-eyebrow, 1.35);
  text-transform: uppercase;
}

.vitalyx-questionflow__progress {
  margin: var(--vitalyx-space-3, 0.75rem) 0 0;
  color: var(--vitalyx-text-secondary, var(--ink2));
  font-size: var(--vitalyx-type-progress, 0.8125rem);
  letter-spacing: var(--vitalyx-tracking-progress, 0.01em);
  line-height: var(--vitalyx-leading-progress, 1.4);
}

/* Posição dentro do bloco de contexto. Discreto de propósito: quem manda no
   cabeçalho é "Etapa N de M"; isto só diz onde a pessoa está dentro do passo. */
.vitalyx-questionflow__subprogress {
  margin: var(--vitalyx-space-2, 0.5rem) 0 0;
  color: var(--vitalyx-text-muted, var(--mut2));
  font-size: var(--vitalyx-type-meta, 0.75rem);
  letter-spacing: var(--vitalyx-tracking-progress, 0.01em);
  line-height: var(--vitalyx-leading-meta, 1.4);
  font-variant-numeric: tabular-nums;
}

.vitalyx-questionflow__progress-track {
  height: 0.375rem;
  margin-top: var(--vitalyx-space-4, 1rem);
  overflow: hidden;
  border-radius: var(--vitalyx-radius-pill, 9999px);
  background: var(--vitalyx-surface-subtle, var(--bg));
}

.vitalyx-questionflow__progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--vitalyx-action-primary, var(--em));
  transition: width var(--vitalyx-motion-standard, 320ms)
    var(--vitalyx-ease-standard, cubic-bezier(0.2, 0, 0, 1));
}

@keyframes vitalyx-questionflow-enter-initial {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes vitalyx-questionflow-enter-forward {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes vitalyx-questionflow-enter-back {
  from {
    opacity: 0;
    transform: translateY(-0.75rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes vitalyx-questionflow-selection {
  from {
    opacity: 0.9;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes vitalyx-questionflow-deselection {
  from {
    opacity: 0.9;
    transform: scale(0.99);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes vitalyx-questionflow-attention {
  from {
    opacity: 0;
    transform: translateY(0.25rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes vitalyx-questionflow-handoff {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vitalyx-questionflow[data-questionflow-motion="question"] .vitalyx-questionflow__content {
  animation: vitalyx-questionflow-enter-initial var(--vitalyx-motion-standard, 320ms)
    var(--vitalyx-ease-enter, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

.vitalyx-questionflow[data-questionflow-motion="question"][data-questionflow-direction="forward"]
  .vitalyx-questionflow__content {
  animation-name: vitalyx-questionflow-enter-forward;
}

.vitalyx-questionflow[data-questionflow-motion="question"][data-questionflow-direction="back"]
  .vitalyx-questionflow__content {
  animation-name: vitalyx-questionflow-enter-back;
}

.screen[data-s="aviso"].questionflow-handoff-enter {
  animation: vitalyx-questionflow-handoff var(--vitalyx-motion-fast, 160ms)
    var(--vitalyx-ease-enter, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

.vitalyx-questionflow__content {
  width: min(100%, 44rem);
  margin-inline: auto;
  padding: var(--vitalyx-space-6, 1.5rem) var(--vitalyx-space-6, 1.5rem)
    calc(var(--vitalyx-space-8, 2rem) + env(safe-area-inset-bottom, 0px));
}

.vitalyx-questionflow__back {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: var(--vitalyx-space-2, 0.5rem);
  padding: var(--vitalyx-space-2, 0.5rem) var(--vitalyx-space-3, 0.75rem);
  border: 1px solid var(--vitalyx-border-subtle, var(--line));
  border-radius: var(--vitalyx-radius-pill, 9999px);
  background: var(--vitalyx-surface-raised, var(--card));
  color: var(--vitalyx-text-secondary, var(--ink2));
  font: 600 0.875rem/1.2 inherit;
  cursor: pointer;
}

.vitalyx-questionflow__title {
  margin: var(--vitalyx-space-4, 1rem) 0 0;
  color: var(--vitalyx-text-primary, var(--ink));
  font-family: var(--vitalyx-font-display, inherit);
  font-size: var(--vitalyx-type-heading, clamp(2rem, 5vw, 2.5rem));
  font-weight: 700;
  letter-spacing: var(--vitalyx-tracking-heading, -0.025em);
  line-height: var(--vitalyx-leading-heading, 1.08);
}

.vitalyx-questionflow__helper {
  margin-top: var(--vitalyx-space-4, 1rem);
  color: var(--vitalyx-text-secondary, var(--ink2));
  font-size: var(--vitalyx-type-helper, 1rem);
  letter-spacing: var(--vitalyx-tracking-helper, -0.005em);
  line-height: var(--vitalyx-leading-helper, 1.5);
}

.vitalyx-questionflow__choices {
  display: grid;
  gap: var(--vitalyx-space-3, 0.75rem);
  margin-top: var(--vitalyx-space-6, 1.5rem);
  border: 0;
}

.vitalyx-questionflow__question {
  border: 0;
  padding: 0;
}

.vitalyx-questionflow__context-group {
  display: grid;
  gap: var(--vitalyx-space-3, 0.75rem);
  margin: var(--vitalyx-space-6, 1.5rem) 0 0;
  padding: calc(var(--vitalyx-space-4, 1rem) + var(--vitalyx-space-1, 0.25rem));
  border: 1px solid var(--vitalyx-border-subtle, var(--line));
  border-radius: var(--vitalyx-radius-lg, 1rem);
}

/* Com uma pergunta por tela a moldura do fieldset não separa mais nada: ela só
   empurra o CTA para baixo da dobra. Quando o bloco está dividido, o grupo vira
   a própria tela — a legenda passa a ser a pergunta e a caixa some. */
.vitalyx-questionflow[data-questionflow-context-field] .vitalyx-questionflow__context-group {
  margin-top: var(--vitalyx-space-4, 1rem);
  padding: 0;
  border: 0;
}

.vitalyx-questionflow[data-questionflow-context-field] .vitalyx-questionflow__context-group > legend {
  padding-inline: 0;
  color: var(--vitalyx-text-primary, var(--ink));
  font-size: var(--vitalyx-type-option, 1rem);
}

.vitalyx-questionflow__context-group > legend {
  padding-inline: var(--vitalyx-space-2, 0.5rem);
  color: var(--vitalyx-text-secondary, var(--ink2));
  font-size: var(--vitalyx-type-option, 1rem);
  font-weight: 600;
  line-height: var(--vitalyx-leading-option, 1.35);
}

.vitalyx-questionflow__range-wrap {
  display: grid;
  gap: var(--vitalyx-space-4, 1rem);
  margin-top: var(--vitalyx-space-6, 1.5rem);
  padding: calc(var(--vitalyx-space-4, 1rem) + var(--vitalyx-space-1, 0.25rem));
  border: 1px solid var(--vitalyx-border-subtle, var(--line));
  border-radius: var(--vitalyx-radius-lg, 1rem);
  background: var(--vitalyx-surface-raised, var(--card));
}

.vitalyx-questionflow__range-label {
  display: flex;
  justify-content: space-between;
  color: var(--vitalyx-text-secondary, var(--ink2));
  font-size: var(--vitalyx-type-option, 1rem);
  letter-spacing: var(--vitalyx-tracking-option, -0.01em);
  line-height: var(--vitalyx-leading-option, 1.35);
}

.vitalyx-questionflow__range-label output {
  color: var(--vitalyx-text-primary, var(--ink));
  font-family: var(--vitalyx-font-meta, ui-monospace, monospace);
  font-size: 1.125rem;
  font-weight: 700;
}

.vitalyx-questionflow__range {
  width: 100%;
  min-height: 2.75rem;
  accent-color: var(--vitalyx-action-primary, var(--em));
}

.vitalyx-questionflow__choice {
  display: grid;
  min-height: 4.25rem;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--vitalyx-space-3, 0.75rem);
  padding: var(--vitalyx-space-4, 1rem)
    calc(var(--vitalyx-space-4, 1rem) + var(--vitalyx-space-1, 0.25rem));
  border: 1px solid var(--vitalyx-border-subtle, var(--line));
  border-radius: var(--vitalyx-radius-lg, 1rem);
  background: var(--vitalyx-surface-raised, var(--card));
  box-shadow: var(--vitalyx-elevation-rest, var(--shadow));
  color: var(--vitalyx-text-primary, var(--ink));
  cursor: pointer;
  font-size: var(--vitalyx-type-option, 1rem);
  font-weight: 500;
  letter-spacing: var(--vitalyx-tracking-option, -0.01em);
  line-height: var(--vitalyx-leading-option, 1.35);
  transition:
    border-color var(--vitalyx-motion-fast, 160ms) var(--vitalyx-ease-standard, ease),
    background var(--vitalyx-motion-fast, 160ms) var(--vitalyx-ease-standard, ease),
    box-shadow var(--vitalyx-motion-fast, 160ms) var(--vitalyx-ease-standard, ease),
    transform var(--vitalyx-motion-fast, 160ms) var(--vitalyx-ease-enter, ease);
}

.vitalyx-questionflow__choice.is-selected {
  border-color: var(--vitalyx-action-primary, var(--em));
  background: var(--vitalyx-action-quiet, var(--emlight));
  transform: translateY(-1px);
}

.vitalyx-questionflow__choice:active {
  box-shadow: none;
  transform: translateY(0) scale(0.985);
}

.vitalyx-questionflow__choice[data-questionflow-selection="selected"] {
  animation: vitalyx-questionflow-selection var(--vitalyx-motion-fast, 160ms)
    var(--vitalyx-ease-enter, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

.vitalyx-questionflow__choice[data-questionflow-selection="deselected"] {
  animation: vitalyx-questionflow-deselection var(--vitalyx-motion-fast, 160ms)
    var(--vitalyx-ease-exit, cubic-bezier(0.7, 0, 0.84, 0)) both;
}

.vitalyx-questionflow__choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.vitalyx-questionflow__choice-control {
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--vitalyx-border-strong, var(--mut));
  border-radius: var(--vitalyx-radius-sm, 0.375rem);
  background: var(--vitalyx-surface-raised, var(--card));
}

.vitalyx-questionflow__choice input[type="radio"] + .vitalyx-questionflow__choice-control {
  border-radius: var(--vitalyx-radius-pill, 9999px);
}

.vitalyx-questionflow__choice.is-selected .vitalyx-questionflow__choice-control {
  border-color: var(--vitalyx-action-primary, var(--em));
  background: var(--vitalyx-action-primary, var(--em));
  box-shadow: inset 0 0 0 0.25rem var(--vitalyx-surface-raised, var(--card));
}

.vitalyx-questionflow__choice input[type="checkbox"] + .vitalyx-questionflow__choice-control::after {
  display: block;
  width: 0.4rem;
  height: 0.7rem;
  margin: 0.12rem auto 0;
  border: solid var(--vitalyx-text-inverse, var(--card));
  border-width: 0 2px 2px 0;
  content: "";
  opacity: 0;
  transform: rotate(45deg) scale(0.7);
  transition: opacity var(--vitalyx-motion-fast, 160ms) var(--vitalyx-ease-standard, ease),
    transform var(--vitalyx-motion-fast, 160ms) var(--vitalyx-ease-standard, ease);
}

.vitalyx-questionflow__choice.is-selected input[type="checkbox"] + .vitalyx-questionflow__choice-control::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.vitalyx-questionflow__choice:has(input:focus-visible),
.vitalyx-questionflow button:focus-visible,
.vitalyx-questionflow__range:focus-visible,
.vitalyx-questionflow__title:focus-visible {
  outline: 3px solid var(--vitalyx-focus-ring, var(--em));
  outline-offset: 3px;
}

.vitalyx-questionflow__empty {
  padding: var(--vitalyx-space-4, 1rem);
  border: 1px solid var(--vitalyx-border-subtle, var(--line));
  border-radius: var(--vitalyx-radius-md, 0.75rem);
  background: var(--vitalyx-surface-subtle, var(--bg));
  color: var(--vitalyx-text-secondary, var(--ink2));
}

.vitalyx-questionflow__error {
  margin-top: var(--vitalyx-space-4, 1rem);
  color: var(--vitalyx-status-danger, var(--warnd));
  font-weight: 600;
}

.vitalyx-questionflow__error.is-visible {
  animation: vitalyx-questionflow-attention var(--vitalyx-motion-fast, 160ms)
    var(--vitalyx-ease-enter, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

.vitalyx-questionflow__continue {
  width: 100%;
  min-height: 3.25rem;
  margin-top: var(--vitalyx-space-8, 2rem);
  padding-inline: var(--vitalyx-space-6, 1.5rem);
  border: 0;
  border-radius: var(--vitalyx-radius-md, 0.75rem);
  background: var(--vitalyx-action-primary, var(--em));
  color: var(--vitalyx-text-inverse, var(--card));
  font-family: var(--vitalyx-font-body, inherit);
  font-size: var(--vitalyx-type-button, 1rem);
  font-weight: 700;
  letter-spacing: var(--vitalyx-tracking-button, -0.01em);
  line-height: var(--vitalyx-leading-button, 1.2);
  cursor: pointer;
  transition: background var(--vitalyx-motion-fast, 160ms) var(--vitalyx-ease-standard, ease),
    box-shadow var(--vitalyx-motion-fast, 160ms) var(--vitalyx-ease-standard, ease),
    transform var(--vitalyx-motion-fast, 160ms) var(--vitalyx-ease-standard, ease);
}

.vitalyx-questionflow__continue:hover {
  background: var(--vitalyx-action-primary-hover, var(--em2));
}

.vitalyx-questionflow__continue:active {
  transform: scale(0.985);
}

.vitalyx-questionflow__continue:disabled,
.vitalyx-questionflow__continue[aria-disabled="true"] {
  box-shadow: none;
  background: var(--vitalyx-surface-subtle, var(--bg));
  color: var(--vitalyx-text-muted, var(--mut));
  cursor: not-allowed;
}

.vitalyx-questionflow__continue[data-questionflow-loading="true"] {
  cursor: wait;
}

.vitalyx-questionflow__continue[data-questionflow-loading="true"]::after {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: var(--vitalyx-space-2, 0.5rem);
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--vitalyx-radius-pill, 9999px);
  content: "";
  vertical-align: -0.1em;
}

.vitalyx-questionflow[data-questionflow-cta-mode="sticky"] .vitalyx-questionflow__continue {
  position: sticky;
  z-index: 1;
  bottom: max(var(--vitalyx-space-3, 0.75rem), env(safe-area-inset-bottom, 0px));
  box-shadow: var(--vitalyx-elevation-raised, var(--shadow));
}

.vitalyx-questionflow__footer {
  display: grid;
  gap: var(--vitalyx-space-2, 0.5rem);
  margin-top: auto;
  padding: var(--vitalyx-space-4, 1rem) var(--vitalyx-space-6, 1.5rem)
    calc(var(--vitalyx-space-4, 1rem) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--vitalyx-border-subtle, var(--line));
  color: var(--vitalyx-text-muted, var(--mut));
  font-family: var(--vitalyx-font-meta, ui-monospace, monospace);
  font-size: var(--vitalyx-type-meta, 0.6875rem);
  letter-spacing: 0.01em;
  line-height: var(--vitalyx-leading-meta, 1.45);
}

.vitalyx-questionflow__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .vitalyx-questionflow__choice,
  .vitalyx-questionflow__progress-track > span,
  .vitalyx-questionflow__choice.is-selected {
    transition-duration: var(--vitalyx-motion-instant, 0ms);
    transform: none;
  }

  .vitalyx-questionflow[data-questionflow-motion="question"] .vitalyx-questionflow__content,
  .vitalyx-questionflow__choice[data-questionflow-selection],
  .vitalyx-questionflow__error.is-visible,
  .screen[data-s="aviso"].questionflow-handoff-enter {
    animation: none;
  }
}

.vitalyx-questionflow[data-questionflow-motion-mode="reduced"] .vitalyx-questionflow__choice,
.vitalyx-questionflow[data-questionflow-motion-mode="reduced"]
  .vitalyx-questionflow__progress-track
  > span,
.vitalyx-questionflow[data-questionflow-motion-mode="reduced"]
  .vitalyx-questionflow__choice.is-selected {
  transition-duration: var(--vitalyx-motion-instant, 0ms);
  transform: none;
}

.vitalyx-questionflow[data-questionflow-motion-mode="reduced"] .vitalyx-questionflow__content,
.vitalyx-questionflow[data-questionflow-motion-mode="reduced"]
  .vitalyx-questionflow__choice[data-questionflow-selection],
.vitalyx-questionflow[data-questionflow-motion-mode="reduced"]
  .vitalyx-questionflow__error.is-visible,
.screen[data-s="aviso"].questionflow-handoff-reduced {
  animation: none;
}

@media (min-width: 48rem) {
  .vitalyx-questionflow__header {
    padding-inline: var(--vitalyx-space-8, 2rem);
  }

  .vitalyx-questionflow__content {
    padding-inline: var(--vitalyx-space-8, 2rem);
  }
}
