/* Telas do quiz (etapa 2 em diante). Tokens e orbe vêm de styles.css. */

.quiz {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px max(28px, env(safe-area-inset-bottom));
}

/* ---------- Cabeçalho: voltar + progresso ---------- */

.quiz__header {
  position: sticky;
  top: 0;
  z-index: 10;
  flex: none;
  display: flex;
  align-items: center;
  height: 56px;
  margin: 0 -20px;
  padding: 0 8px;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
}

.quiz__back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.quiz__back:hover {
  background: rgba(244, 239, 230, 0.08);
}

.quiz__back svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* O trilho inteiro é o arco-íris; a máscara escura recua da direita conforme --p cresce. */
.quiz__progress {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  overflow: hidden;
  background: linear-gradient(90deg, #ff5d62, #ff9d42, #ffd84d, #4fd68e, #4fa9ff, #8583ff, #bb80ff);
}

.quiz__progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #26243a;
  transform-origin: right;
  transform: scaleX(calc(1 - var(--p, 0)));
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Tela ---------- */

.quiz__screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  text-align: center;
}

.quiz__screen > * {
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.quiz__screen > :nth-child(2) { animation-delay: 0.06s; }
.quiz__screen > :nth-child(3) { animation-delay: 0.12s; }
.quiz__screen > :nth-child(4) { animation-delay: 0.18s; }
.quiz__screen > :nth-child(5) { animation-delay: 0.24s; }

.q-title {
  margin: 0 0 24px;
  max-width: 20ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.65rem, 6.6vw, 2.05rem);
  line-height: 1.14;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.q-title:focus {
  outline: none;
}

.q-title em {
  font-style: italic;
  color: var(--aura);
}

/* Em telas baixas o texto pode passar da dobra; o botão fica preso ao rodapé e nunca some. */
.quiz__screen .cta {
  position: sticky;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 2;
  margin-top: 28px;
}

/* ---------- Pergunta de escolha única ---------- */

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.options button,
.cards button,
.scale button {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(244, 239, 230, 0.05);
  color: var(--ink);
  font: 500 1rem/1.3 var(--font-body);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.options button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 12px 18px;
  text-align: left;
}

/* Só onde há ponteiro de verdade: no toque o :hover "gruda" na opção sob o dedo da tela seguinte. */
@media (hover: hover) {
  .options button:hover,
  .cards button:hover,
  .scale button:hover {
    border-color: rgba(244, 239, 230, 0.3);
    background: rgba(244, 239, 230, 0.09);
  }
}

.options button:active,
.cards button:active,
.scale button:active {
  transform: scale(0.985);
}

.options button.is-selected,
.cards button.is-selected,
.scale button.is-selected {
  border-color: var(--tint);
  background: color-mix(in oklab, var(--tint) 16%, transparent);
  box-shadow: 0 0 0 1px var(--tint), 0 0 28px color-mix(in oklab, var(--tint) 32%, transparent);
}

.options__icon,
.cards__icon {
  flex: none;
  fill: none;
  stroke: var(--tint);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.options__icon {
  width: 24px;
  height: 24px;
}

/* ---------- Múltipla escolha ---------- */

.q-hint {
  margin: -12px 0 18px;
  max-width: 36ch;
  font-size: 0.875rem;
  color: var(--ink-faint);
  text-wrap: pretty;
}

.options__check {
  flex: none;
  width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 3px;
  border: 1.5px solid rgba(244, 239, 230, 0.28);
  border-radius: 50%;
  fill: none;
  stroke: transparent;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.is-selected .options__check {
  border-color: var(--tint);
  background: var(--tint);
  stroke: #14121f;
}

/* Limite atingido: o que sobrou esmaece, mas dá para desmarcar e trocar. */
.options.is-full button:not(.is-selected) {
  opacity: 0.4;
  cursor: default;
}

/* Opaco de propósito: em telas baixas o botão fica preso por cima da lista de opções. */
.cta:disabled {
  background: #2b2938;
  color: rgba(244, 239, 230, 0.42);
  box-shadow: 0 0 0 1px var(--line), 0 -8px 24px var(--bg);
  cursor: not-allowed;
  transform: none;
}

/* ---------- Escala de concordância ---------- */

.statement {
  width: 100%;
  margin: 0 0 26px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(244, 239, 230, 0.05);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.3;
  text-wrap: balance;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
}

.scale button {
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  border-color: color-mix(in oklab, var(--tint) 55%, transparent);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tint);
}

.scale button.is-selected {
  color: var(--ink);
}

.scale__legend {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin: 12px 0 0;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* ---------- Cards com ilustração ---------- */

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.cards button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 12px 22px;
}

.cards__icon {
  width: 72px;
  height: 72px;
  stroke-width: 1.2;
}

/* Seis cards (família): ícone e respiro menores para caber em três linhas. */
.cards--compact button {
  gap: 10px;
  padding: 18px 10px 16px;
  font-size: 0.9375rem;
}

.cards--compact .cards__icon {
  width: 52px;
  height: 52px;
  stroke-width: 1.3;
}

/* ---------- Data de nascimento ---------- */

/* Signo da data escolhida, entre os dois vizinhos no zodíaco. Os medalhões vêm de js/art.js. */
.signs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin-bottom: 16px;
}

.signs figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.sign {
  display: block;
  height: auto;
}

.signs__side {
  font-size: 0.875rem;
  color: var(--ink-faint);
}

.signs__side .sign {
  width: min(15vw, 7dvh, 60px);
  opacity: 0.55;
}

.signs__main {
  font-size: 1.0625rem;
  font-weight: 700;
}

.signs__main .sign {
  width: min(32vw, 15dvh, 128px);
  filter: drop-shadow(0 0 26px rgba(217, 211, 255, 0.35));
  animation: sign-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Seletor de rolagem: --row é a altura de cada linha e --rows quantas aparecem. */
.wheel {
  --row: 40px;
  --rows: 5;
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.1fr;
  gap: 4px;
  width: 100%;
  max-width: 360px;
  height: calc(var(--row) * var(--rows));
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(244, 239, 230, 0.04);
}

/* Faixa que marca a linha escolhida. */
.wheel::before {
  content: "";
  position: absolute;
  inset: calc(50% - var(--row) / 2) 10px auto;
  height: var(--row);
  border-radius: 12px;
  background: rgba(244, 239, 230, 0.1);
  pointer-events: none;
}

.wheel__column {
  position: relative;
  margin: 0;
  padding: calc((var(--rows) - 1) / 2 * var(--row)) 0; /* deixa o primeiro e o último item chegarem ao meio */
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
  mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
}

.wheel__column::-webkit-scrollbar {
  display: none;
}

.wheel__column li {
  display: grid;
  place-items: center;
  height: var(--row);
  scroll-snap-align: center;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  cursor: pointer;
}

.wheel__column li.is-selected {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
}

.wheel__column li.is-off {
  opacity: 0.3;
}

.date-note {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: #ff8a8e;
}

[data-type="birthdate"] .cta {
  margin-top: 8px;
}

@keyframes sign-in {
  from { opacity: 0; transform: scale(0.8); }
}

/* Telas baixas: três linhas no seletor para o botão caber sem cobrir a lista. */
@media (max-height: 640px) {
  .wheel {
    --rows: 3;
  }
}

/* A página final tem o próprio topo; o cabeçalho do quiz sai. */
.quiz--bare .quiz__header {
  display: none;
}

.quiz--bare .quiz__screen {
  padding-top: 0;
}

/* ---------- Tela de pista / validação ---------- */

.orb--sm {
  width: min(58vw, 27dvh, 250px);
  margin-bottom: 18px;
}

.orb.is-neutral .orb__icon {
  filter: drop-shadow(0 1px 7px rgba(44, 22, 96, 0.55));
}

.clue-chip {
  display: inline-flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.06);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.clue-chip strong {
  font-weight: 700;
  color: var(--aura);
}

[data-type="payoff"] .q-title,
[data-type="wip"] .q-title {
  margin-bottom: 14px;
}

.payoff__body {
  margin: 0;
  max-width: 34ch;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ---------- Etapa 35: as pistas vão para o orbe ---------- */

[data-type="summary"] .orb--sm {
  z-index: 1;
  width: min(40vw, 19dvh, 170px);
  transform-origin: top;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.clues {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  transition: height 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.clues li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 10px;
  border: 1px solid color-mix(in oklab, var(--tint) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--tint) 10%, transparent);
  font-size: 0.8125rem;
  font-weight: 500;
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 70ms + 200ms);
  transition: transform 0.6s cubic-bezier(0.5, 0, 0.3, 1), opacity 0.6s ease-in;
}

/* --dx e --dy (distância até o centro do orbe) são medidos por js/quiz.js. */
.clues.is-gathered li {
  transform: translate(var(--dx), var(--dy)) scale(0.25);
  opacity: 0;
}

.clues__icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--tint);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Etapa 36: análise ---------- */

.analysis {
  display: grid;
  gap: 20px;
  width: 100%;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.analysis li {
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.analysis li.is-active,
.analysis li.is-done {
  opacity: 1;
}

.analysis p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 9px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.analysis [data-percent] {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.analysis__track {
  height: 8px;
  border-radius: 999px;
  background: #26243a;
}

/* O arco-íris ocupa o trilho todo e é revelado da esquerda para a direita conforme --p cresce. */
.analysis__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff5d62, #ff9d42, #ffd84d, #4fd68e, #4fa9ff, #8583ff, #bb80ff);
  clip-path: inset(0 calc(100% - var(--p, 0) * 100%) 0 0 round 999px);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 7, 16, 0.74);
  backdrop-filter: blur(6px);
}

.modal[hidden] {
  display: none;
}

.quiz__screen > .modal {
  animation: modal-in 0.25s ease both;
}

.modal__card {
  width: min(100%, 380px);
  padding: 28px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #17152a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 70px color-mix(in oklab, var(--aura) 14%, transparent);
  animation: modal-card-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.2;
  text-wrap: balance;
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.modal__actions button {
  min-height: 54px;
  border: 1px solid rgba(244, 239, 230, 0.22);
  border-radius: 16px;
  background: rgba(244, 239, 230, 0.06);
  color: var(--ink);
  font: 600 1rem/1 var(--font-body);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) {
  .modal__actions button:hover {
    border-color: rgba(244, 239, 230, 0.4);
    background: rgba(244, 239, 230, 0.12);
  }
}

.modal__actions button:active {
  transform: scale(0.98);
}

.modal__alert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font: 700 1.125rem/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff9d42;
}

.modal__alert svg,
.modal__notice svg {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal__body {
  margin: 12px 0 0;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.modal .cta {
  position: static;
  margin-top: 20px;
}

.modal__notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.modal__notice svg {
  width: 18px;
  height: 18px;
  color: #4fd68e;
}

@keyframes modal-in {
  from { opacity: 0; }
}

@keyframes modal-card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
}

/* ---------- Prova social ---------- */

.testimonial {
  width: 100%;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--aura);
  border-radius: 6px 18px 18px 6px;
  background: rgba(244, 239, 230, 0.05);
  text-align: left;
}

.testimonial__stars {
  display: flex;
  gap: 3px;
}

.testimonial__stars svg {
  width: 16px;
  height: 16px;
  fill: #ffd84d;
}

.testimonial blockquote {
  margin: 10px 0 12px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.35;
}

.testimonial figcaption {
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.metrics {
  width: 100%;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  color: var(--ink-soft);
}

.metrics li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
}

.metrics li + li {
  border-top: 1px solid var(--line);
}

.metrics strong {
  font-weight: 700;
  color: var(--ink);
}

.metrics__icon {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--aura) 14%, transparent);
  fill: none;
  stroke: var(--aura);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 960px) {
  .quiz__screen {
    padding-top: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz__screen > *,
  .clues li,
  .modal__card,
  .signs__main .sign {
    animation: none;
  }

  .quiz__progress::after,
  .options button,
  .cards button,
  .scale button {
    transition: none;
  }
}
