/* ---------------------------------------------------------------------------
   Questionário — tela inicial, perguntas e transições
--------------------------------------------------------------------------- */

.survey-page { overflow: hidden; }

/* Barra de progresso */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.05);
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.7s var(--ease-out);
}

/* Topo */
.survey-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  z-index: 20;
  pointer-events: none;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(216, 189, 148, 0.55);
}

.survey-count {
  font-size: 13px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

/* Palco e telas */
.stage { position: relative; height: 100dvh; z-index: 1; }

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  place-items: center;
  padding: 92px 24px 40px;
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
}

.screen.is-on { opacity: 1; }
.screen.is-off { opacity: 0; pointer-events: none; }

.screen__inner {
  width: 100%;
  max-width: 640px;
  transition: transform 0.55s var(--ease-out), filter 0.55s var(--ease-out);
}

.screen.is-off .screen__inner { transform: translateY(-22px); filter: blur(6px); }
.screen.pre-enter .screen__inner { transform: translateY(26px); filter: blur(8px); }

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

.screen--intro .screen__inner { max-width: 560px; text-align: center; }

.intro-title {
  font-size: clamp(30px, 5.4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin: 18px 0 14px;
  min-height: 1.2em;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: -0.12em;
  animation: blink 1.05s steps(1) infinite;
  transition: opacity 0.6s;
}

.caret.done { opacity: 0; }

@keyframes blink { 50% { opacity: 0; } }

.intro-sub {
  color: var(--text-2);
  font-size: 16.5px;
  font-weight: 300;
  margin-bottom: 42px;
}

.identity { display: flex; flex-direction: column; gap: 18px; text-align: left; }

.identity .btn { margin-top: 14px; align-self: center; min-width: 172px; }

.intro-micro { margin-top: 26px; font-size: 13px; color: var(--text-3); }

.field-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  margin-top: -8px;
  opacity: 0;
  transition: opacity 0.3s;
}

.field-error.is-on { opacity: 1; }

/* --- Perguntas ----------------------------------------------------------------- */

.q-head { margin-bottom: 30px; }

.q-title {
  font-size: clamp(25px, 4.2vw, 36px);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.24;
  margin-top: 14px;
}

.q-sub { color: var(--text-2); font-size: 16.5px; font-weight: 300; margin-top: 12px; }

.q-desc { color: var(--text-3); font-size: 14.5px; margin-top: 10px; }

.q-media { margin: 26px 0 4px; display: flex; flex-direction: column; gap: 14px; }

.q-media > figure {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-2);
  overflow: hidden;
}

.q-media > figure img {
  width: 100%;
  max-height: min(44vh, 400px);
  object-fit: contain;
}

/* Alternativas */
.options { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }

.options--media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 18px;
  cursor: pointer;
  color: var(--text-1);
  font-size: 15.5px;
  transition: border-color 0.25s, background 0.25s, transform 0.3s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.option:hover { border-color: var(--border-2); background: var(--surface-2); transform: translateY(-1px); }

.option.is-selected {
  border-color: rgba(216, 189, 148, 0.65);
  background: var(--accent-dim);
}

.option.is-selected .kbd { border-color: rgba(216, 189, 148, 0.5); color: var(--accent); }

.option__label { flex: 1; line-height: 1.45; }

.option__check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--accent);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s, transform 0.35s var(--ease-out);
}

.option.is-selected .option__check { opacity: 1; transform: scale(1); }

/* Alternativa com mídia */
.options--media .option { flex-direction: column; align-items: stretch; gap: 12px; padding: 10px 10px 14px; }

.option__thumb {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: 9px;
  background: var(--bg-2);
}

.options--media .option__row { display: flex; align-items: center; gap: 10px; padding: 0 6px; }

.option-hint { margin-top: 14px; font-size: 13px; color: var(--text-3); }

/* Campo aberto */
.txt-wrap { margin-top: 30px; }

.txt {
  width: 100%;
  min-height: 120px;
  max-height: 40vh;
  resize: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-2);
  padding: 6px 2px 14px;
  font-size: 19px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-1);
  caret-color: var(--accent);
  outline: none;
  transition: border-color 0.3s;
}

.txt::placeholder { color: var(--text-3); }

.txt-line { height: 1px; background: var(--accent); width: 0%; transition: width 0.5s var(--ease-out); margin-top: -1px; }

.txt:focus ~ .txt-line, .txt-wrap:focus-within .txt-line { width: 100%; }

/* Navegação */
.q-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 44px;
  gap: 14px;
}

.q-nav__hint { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }

.q-nav .btn { padding: 12px 24px; }

.btn-back {
  background: none;
  border: 0;
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: color 0.25s;
}

.btn-back:hover { color: var(--text-1); }

/* Tela final */
.screen--end .screen__inner { text-align: center; max-width: 480px; }

.end-title {
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.end-sub { color: var(--text-2); font-weight: 300; margin-top: 14px; }

@media (max-width: 640px) {
  .screen { padding: 84px 20px 32px; }
  .q-nav { margin-top: 36px; }
  .q-nav__hint { display: none; }
  .options--media { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .options--media { grid-template-columns: 1fr; }
}
