/* =====================================================================
   TRIAGEM GUIADA — folha de estilo independente.
   Página autônoma: não depende do style.css do site.
   Para reaproveitar em outro projeto, ajuste apenas o bloco :root.
   ===================================================================== */

:root {
  --surface: #121414;
  --surface-dim: #0c0f0f;
  --surface-high: #282a2b;
  --on-surface: #e2e2e2;
  --off-white: #f4f1ea;
  --primary: #96836b;
  --error: #d59a7c;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--surface-dim);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--surface-dim);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border: 0px solid var(--surface-dim);
  border-radius: 0 !important;
}

@media (max-width: 768px) {
  html {
    font-size: 90%;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 82.5%;
  }
}

body {
  margin: 0;
  background: var(--surface-dim);
  color: var(--on-surface);
  font-family: var(--sans);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .75rem 1.6rem;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: .12em;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
}

.button:hover {
  transform: translateY(-2px);
  color: var(--off-white);
  background: rgba(150, 131, 107, .1);
}

/* --- Estrutura da página --- */
.triage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  /* Altura fixa (não min-height): prende topo e rodapé, e a rolagem
     acontece dentro do palco — como num formulário de tela cheia. */
  height: 100vh;
  height: 100dvh;
  background:
    radial-gradient(circle at 78% 8%, rgba(150, 131, 107, .13), transparent 42%),
    radial-gradient(circle at 12% 92%, rgba(150, 131, 107, .08), transparent 38%),
    var(--surface-dim);
  animation: triage-enter .45s ease both;
}

@keyframes triage-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* --- Topo: marca, progresso e contador --- */
.triage__chrome {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(1rem, 2.4vw, 1.6rem) clamp(1.25rem, 4vw, 3.5rem);
  border-bottom: 1px solid rgba(150, 131, 107, .16);
}

.triage__mark {
  height: clamp(42px, 6vw, 64px);
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .85;
}

.triage__track {
  position: relative;
  flex: 1;
  height: 1px;
  background: rgba(226, 226, 226, .16);
}

.triage__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(150, 131, 107, .5), var(--primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s cubic-bezier(.22, .61, .36, 1);
}

/* Progresso em passos discretos: dispensa estilo inline (compatível com CSP restritiva). */
.triage[data-progress="0"] .triage__fill {
  transform: scaleX(0);
}

.triage[data-progress="1"] .triage__fill {
  transform: scaleX(.14);
}

.triage[data-progress="2"] .triage__fill {
  transform: scaleX(.28);
}

.triage[data-progress="3"] .triage__fill {
  transform: scaleX(.42);
}

.triage[data-progress="4"] .triage__fill {
  transform: scaleX(.56);
}

.triage[data-progress="5"] .triage__fill {
  transform: scaleX(.7);
}

.triage[data-progress="6"] .triage__fill {
  transform: scaleX(.84);
}

.triage[data-progress="7"] .triage__fill {
  transform: scaleX(.94);
}

.triage[data-progress="8"] .triage__fill {
  transform: scaleX(1);
}

.triage__counter {
  min-width: 5ch;
  margin: 0;
  color: rgba(226, 226, 226, .5);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .18em;
}

.triage__exit {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(226, 226, 226, .22);
  color: rgba(226, 226, 226, .75);
  font-size: 1.1rem;
  line-height: 1;
  transition: border-color .25s ease, color .25s ease, transform .25s ease;
}

.triage__exit:hover {
  border-color: rgba(150, 131, 107, .8);
  color: var(--off-white);
  transform: rotate(90deg);
}

/* --- Palco das perguntas --- */
.triage__stage {
  position: relative;
  display: grid;
  /* "safe" evita que telas altas (o resumo final) fiquem cortadas no topo. */
  align-items: safe center;
  padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.triage-step {
  position: relative;
  width: min(760px, 100%);
  margin-inline: auto;
}

/* Numeral fantasma: cada pergunta é um "artigo" do dossiê. */
.triage-step::before {
  content: attr(data-numeral);
  position: absolute;
  top: 50%;
  right: -.06em;
  z-index: 0;
  color: rgba(150, 131, 107, .07);
  font-family: var(--serif);
  font-size: clamp(9rem, 22vw, 18rem);
  line-height: .78;
  transform: translateY(-52%);
  pointer-events: none;
  user-select: none;
}

.triage-step>* {
  position: relative;
  z-index: 1;
}

.triage-step__index {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 1rem;
  color: var(--primary);
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.triage-step__index::after {
  content: '';
  width: clamp(28px, 6vw, 64px);
  height: 1px;
  background: rgba(150, 131, 107, .5);
}

.triage-step h1 {
  margin: 0 0 .7rem;
  color: var(--off-white);
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
}

.triage-step__hint {
  max-width: 54ch;
  margin: 0 0 1.9rem;
  color: rgba(244, 241, 234, .6);
  font-size: 1rem;
}

/* Prévia dos temas na abertura: dá noção do percurso antes de começar. */
.triage-topics {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.5rem;
  margin: 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid rgba(150, 131, 107, .22);
  list-style: none;
}

.triage-topics li {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: rgba(244, 241, 234, .55);
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.triage-topics li::before {
  content: '';
  width: 5px;
  height: 5px;
  border: 1px solid var(--primary);
  transform: rotate(45deg);
}

/* --- Opções (cartões com letra de atalho) --- */
.triage-options {
  display: grid;
  gap: .6rem;
}

.triage-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.05rem 1.2rem;
  border: 1px solid rgba(226, 226, 226, .16);
  background: rgba(226, 226, 226, .03);
  color: var(--on-surface);
  font-size: 1.02rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .22s ease, background .22s ease, transform .22s ease;
}

.triage-option:hover {
  border-color: rgba(150, 131, 107, .65);
  background: rgba(150, 131, 107, .09);
  transform: translateX(5px);
}

.triage-option__key {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(150, 131, 107, .5);
  color: var(--primary);
  font-size: .76rem;
  letter-spacing: .04em;
  transition: background .22s ease, color .22s ease, border-color .22s ease;
}

.triage-option:hover .triage-option__key,
.triage-option.is-selected .triage-option__key {
  background: var(--primary);
  border-color: var(--primary);
  color: #221c12;
}

.triage-option.is-selected {
  border-color: var(--primary);
  background: rgba(150, 131, 107, .14);
}

.triage-option__label {
  flex: 1;
}

.triage-option__note {
  display: block;
  margin-top: .18rem;
  color: rgba(244, 241, 234, .5);
  font-size: .84rem;
  letter-spacing: .02em;
}

/* --- Campos --- */
.triage-field {
  display: block;
  width: 100%;
  padding: .85rem .2rem;
  border: 0;
  border-bottom: 1px solid rgba(150, 131, 107, .42);
  border-radius: 0;
  background: transparent;
  color: var(--off-white);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  line-height: 1.45;
  transition: border-color .25s ease;
}

.triage-field::placeholder {
  color: rgba(244, 241, 234, .26);
}

.triage-field:focus {
  outline: none;
  border-bottom-color: var(--primary);
}

textarea.triage-field {
  min-height: 8.5rem;
  padding: .8rem 1rem;
  border: 1px solid rgba(150, 131, 107, .32);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  resize: vertical;
}

textarea.triage-field:focus {
  border-color: var(--primary);
}

.triage-error {
  min-height: 1.35rem;
  margin: .7rem 0 0;
  color: var(--error);
  font-size: .87rem;
  letter-spacing: .04em;
}

/* --- Conferência final --- */
.triage-review {
  display: grid;
  margin: 0 0 1.9rem;
  border-top: 1px solid rgba(150, 131, 107, .22);
}

.triage-review__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
  gap: 1rem;
  padding: .62rem .2rem;
  border-bottom: 1px solid rgba(150, 131, 107, .16);
}

.triage-review__key {
  margin: 0;
  color: var(--primary);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.triage-review__value {
  margin: 0;
  color: var(--off-white);
  font-size: 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Na conferência o texto cede espaço para a lista de respostas. */
.triage-step[data-step-id="review"] h1 {
  font-size: clamp(1.3rem, 2.5vw, 1.85rem);
}

.triage-step[data-step-id="review"] .triage-step__hint {
  margin-bottom: 1.1rem;
}

/* --- Rodapé de navegação --- */
.triage__foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 2.4vw, 1.5rem) clamp(1.25rem, 4vw, 3.5rem);
  border-top: 1px solid rgba(150, 131, 107, .16);
}

/* Véu sobre o rodapé: indica que a tela continua abaixo quando há rolagem. */
.triage__foot::before {
  content: '';
  position: absolute;
  inset: auto 0 100% 0;
  height: 3rem;
  background: linear-gradient(to top, rgba(12, 15, 15, .92), transparent);
  pointer-events: none;
}

.triage__back {
  padding: .6rem .2rem;
  border: 0;
  background: transparent;
  color: rgba(226, 226, 226, .55);
  font-size: .85rem;
  letter-spacing: .12em;
  cursor: pointer;
  transition: color .22s ease;
}

.triage__back:hover {
  color: var(--primary);
}

.triage__back[hidden] {
  display: none;
}

.triage__next {
  margin-left: auto;
}

.triage__next:hover {
  background: transparent;
  color: var(--primary);
}

.triage__kbd {
  display: none;
  margin: 0;
  color: rgba(226, 226, 226, .38);
  font-size: .78rem;
  letter-spacing: .1em;
}

.triage__kbd b {
  color: rgba(226, 226, 226, .62);
  font-weight: 400;
}

@media (min-width: 720px) {
  .triage__kbd {
    display: block;
    margin-left: auto;
  }

  .triage__next {
    margin-left: 1.25rem;
  }

  .triage__social {
    margin-left: 1.5rem;
  }
}

.triage__social {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-left: 0.5rem;
}

.triage__social-link {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(226, 226, 226, 0.4);
  background: rgba(226, 226, 226, 0.1);
  color: var(--off-white);
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease, color 0.22s ease;
}

.triage__social-link img,
.triage__social-link svg {
  width: 18px;
  height: 18px;
  opacity: 1;
  filter: brightness(0) invert(1);
  transition: opacity 0.22s ease, filter 0.22s ease;
}

.triage__social-link:hover {
  border-color: rgba(226, 226, 226, 0.8);
  background: rgba(226, 226, 226, 0.2);
  color: #ffffff;
  transform: translateY(-2px);
}

.triage__social-link:hover img,
.triage__social-link:hover svg {
  opacity: 1;
}

/* --- Movimento: entrada com direção (avançar sobe, voltar desce) --- */
.triage-step.is-active {
  animation: triage-step-fwd .5s cubic-bezier(.22, .61, .36, 1) both;
}

.triage[data-dir="back"] .triage-step.is-active {
  animation-name: triage-step-back;
}

@keyframes triage-step-fwd {
  from {
    opacity: 0;
    transform: translateY(26px);
  }

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

@keyframes triage-step-back {
  from {
    opacity: 0;
    transform: translateY(-22px);
  }

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

.triage-step.is-active>* {
  animation: triage-rise .55s cubic-bezier(.22, .61, .36, 1) both;
}

.triage-step.is-active>*:nth-child(1) {
  animation-delay: .04s;
}

.triage-step.is-active>*:nth-child(2) {
  animation-delay: .1s;
}

.triage-step.is-active>*:nth-child(3) {
  animation-delay: .16s;
}

.triage-step.is-active>*:nth-child(4) {
  animation-delay: .22s;
}

.triage-step.is-active>*:nth-child(5) {
  animation-delay: .28s;
}

@keyframes triage-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@media (max-width: 560px) {
  .triage-review__row {
    grid-template-columns: 1fr;
    gap: .25rem;
  }

  .triage__counter {
    min-width: auto;
    letter-spacing: .1em;
  }

  .triage-step::before {
    font-size: 8rem;
  }

  .triage__mark {
    height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .triage,
  .triage-step.is-active,
  .triage-step.is-active>* {
    animation: none;
  }

  .triage__fill {
    transition: none;
  }

  .triage-option:hover,
  .triage__exit:hover,
  .button:hover {
    transform: none;
  }
}

/* Sem JavaScript o visitante ainda encontra o caminho do WhatsApp. */
.triage-noscript {
  width: min(760px, 100%);
  margin-inline: auto;
  padding: 2rem;
  border: 1px solid rgba(150, 131, 107, .4);
}

.triage-noscript h1 {
  margin: 0 0 .6rem;
  font-family: var(--serif);
  font-weight: 400;
  color: var(--off-white);
}