/* Aplicação da campanha 2 — Editora Next Level.
   Conversa em thread, painel de opções em tela cheia, cartão de confirmação. */

:root {
  --fundo:        #081e29;
  --fundo-topo:   #06161f;
  --superficie:   rgba(255, 255, 255, .055);
  --superficie-2: rgba(255, 255, 255, .085);
  --borda:        rgba(255, 255, 255, .10);
  --borda-forte:  rgba(255, 255, 255, .18);
  --texto:        #eaf3f7;
  --suave:        #93aeba;
  --marca:        #f2a03d;
  --marca-forte:  #ff9429;
  --erro:         #ff8f7a;
  --raio:         16px;
  --largura:      720px;
  --topo:         clamp(56px, 9vh, 68px);
}

* { box-sizing: border-box; }

/* .painel e .selado tem display proprio: sem isto o atributo hidden nao segura. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70ch 50ch at 18% -5%, rgba(242, 160, 61, .10), transparent 65%),
    radial-gradient(60ch 45ch at 95% 15%, rgba(63, 140, 180, .12), transparent 60%);
  pointer-events: none;
}

/* ------------------------------------------------------------------ barra */

.barra {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--topo);
  background: color-mix(in srgb, var(--fundo-topo) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--borda);
}

.barra-interna {
  max-width: var(--largura);
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.marca { display: flex; flex-direction: column; line-height: 1.05; }
.marca-nome { font-size: .72rem; font-weight: 700; letter-spacing: .16em; }
.marca-cat  { font-size: .54rem; font-weight: 600; letter-spacing: .3em; color: var(--marca); }

/* Trilha de etapas: pontos ligados por um fio que acende conforme avança. */
.trilha {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.trilha li {
  display: flex;
  align-items: center;
  gap: 0;
}

.trilha .ponto {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  flex: none;
  transition: background .35s ease, box-shadow .35s ease, transform .35s ease;
}

.trilha .fio {
  width: clamp(18px, 7vw, 56px);
  height: 2px;
  background: rgba(255, 255, 255, .16);
  position: relative;
  overflow: hidden;
}

.trilha .fio::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--marca);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s ease;
}

.trilha li.feita .ponto { background: var(--marca); }
.trilha li.feita .fio::after { transform: scaleX(1); }
.trilha li.atual .ponto {
  background: #fff;
  transform: scale(1.35);
  box-shadow: 0 0 0 4px rgba(242, 160, 61, .22);
}

.contador { text-align: right; line-height: 1.05; }
.contador strong { display: block; font-size: 1.3rem; font-weight: 700; }
.contador span   { font-size: .6rem; color: var(--suave); letter-spacing: .06em; }

/* ------------------------------------------------------------------ palco */

.palco {
  max-width: var(--largura);
  margin: 0 auto;
  padding: calc(var(--topo) + 28px) 16px 90px;
}

/* --------------------------------------------------------------- abertura */

.abertura { text-align: center; margin-bottom: 38px; }

.selo {
  display: inline-block;
  padding: 7px 14px;
  border: 1.5px solid var(--marca);
  border-radius: 8px;
  color: var(--marca);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.abertura h1 {
  margin: 20px 0 10px;
  font-size: clamp(1.7rem, 5.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.12;
}

.linha-forte {
  margin: 0 auto 20px;
  max-width: 30ch;
  font-size: clamp(1rem, 3.4vw, 1.2rem);
  font-weight: 600;
  color: #cfe0e8;
}

.destaque {
  max-width: 44ch;
  margin: 0 auto;
  padding: 14px 18px;
  text-align: left;
  background: var(--superficie);
  border-left: 3px solid var(--marca);
  border-radius: 0 10px 10px 0;
  font-size: .95rem;
  color: #dbe9ef;
}

.nota { margin: 16px 0 0; font-size: .78rem; color: var(--suave); }

/* -------------------------------------------------------------- conversa */

.conversa { display: flex; flex-direction: column; gap: 14px; }

.fala {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  animation: subir .36s ease both;
}

.fala.minha { flex-direction: row-reverse; }

@keyframes subir {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(140deg, var(--marca), #c9742a);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .95rem;
  color: #22160a;
  overflow: hidden;
  border: 1px solid var(--borda-forte);
}

.avatar.vazio { visibility: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bolha {
  max-width: min(78%, 500px);
  padding: 12px 16px;
  border-radius: 18px;
  font-size: .96rem;
}

.fala.dele .bolha {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-bottom-left-radius: 6px;
}

.fala.minha .bolha {
  background: linear-gradient(135deg, var(--marca-forte), var(--marca));
  color: #1a1006;
  font-weight: 600;
  border-bottom-right-radius: 6px;
}

.fala.minha .bolha ul { margin: 4px 0 0; padding-left: 18px; }

.bolha .dica {
  display: block;
  margin-top: 5px;
  font-size: .78rem;
  color: var(--suave);
}

/* Três pontinhos enquanto o anfitrião "digita". */
.digitando { display: flex; gap: 5px; padding: 15px 18px; }
.digitando i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--suave);
  animation: pulsar 1.1s infinite ease-in-out;
}
.digitando i:nth-child(2) { animation-delay: .15s; }
.digitando i:nth-child(3) { animation-delay: .3s; }

@keyframes pulsar {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30%           { opacity: 1;  transform: translateY(-4px); }
}

/* --------------------------------------------------------------- entrada */

/* A entrada vive dentro da conversa, logo abaixo da pergunta: responder não
   pode exigir olhar para o rodapé da tela. */
.entrada {
  margin-top: 14px;
  animation: subir .3s ease both;
}

.entrada-interna {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.campo {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  padding: 15px 18px;
  background: var(--superficie-2);
  border: 1px solid var(--borda-forte);
  border-radius: 14px;
  color: var(--texto);
  font: inherit;
  font-size: 1rem;
}

.campo::placeholder { color: var(--suave); }
.campo:focus { outline: 2px solid var(--marca); outline-offset: 1px; }
.campo.erro  { border-color: var(--erro); }

.enviar {
  flex: none;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--marca-forte), var(--marca));
  color: #1a1006;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}

.enviar:hover:not(:disabled) { transform: translateY(-1px); }
.enviar:disabled { opacity: .45; cursor: not-allowed; }
.enviar svg { width: 21px; height: 21px; fill: currentColor; }

/* Botão que abre o painel: parece um select fechado, de propósito. */
.gatilho {
  width: min(100%, 420px);
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--superficie-2);
  border: 1px solid var(--borda-forte);
  border-radius: 14px;
  color: var(--suave);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, transform .15s ease;
}

.gatilho:hover { border-color: var(--marca); transform: translateY(-1px); }
.gatilho svg { width: 18px; height: 18px; flex: none; stroke: currentColor; stroke-width: 2; fill: none; }

.aviso {
  margin: 0 0 8px;
  font-size: .82rem;
  color: var(--erro);
  text-align: right;
}

/* ---------------------------------------------------------------- painel */

.painel {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--fundo);
  display: flex;
  flex-direction: column;
  animation: entrar .26s ease both;
}

@keyframes entrar {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.painel-topo {
  flex: none;
  padding: 20px max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--borda);
}

.painel-topo h2 {
  margin: 0;
  font-size: clamp(1.1rem, 3.6vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -.01em;
}

.painel-topo p { margin: 4px 0 0; font-size: .85rem; color: var(--suave); }

.painel-fechar {
  flex: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--borda-forte);
  border-radius: 50%;
  background: transparent;
  color: var(--texto);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.painel-fechar:hover { background: var(--superficie); }
.painel-fechar svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

.painel-corpo {
  flex: 1;
  overflow-y: auto;
  padding: 24px max(16px, env(safe-area-inset-left)) 40px;
  display: flex;
  flex-direction: column;
}

.opcoes {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opcao {
  width: 100%;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 14px;
  color: var(--texto);
  font: inherit;
  font-size: .97rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .12s ease;
}

.opcao:hover { border-color: var(--marca); background: var(--superficie-2); transform: translateY(-1px); }
.opcao:focus-visible { outline: 2px solid var(--marca); outline-offset: 2px; }
.opcao span { flex: 1; }

.opcao .seta { width: 17px; height: 17px; flex: none; stroke: var(--suave); stroke-width: 2; fill: none; }

/* Caixinha das perguntas de múltipla escolha. */
.opcao .caixa {
  width: 22px;
  height: 22px;
  flex: none;
  border: 1.5px solid var(--borda-forte);
  border-radius: 6px;
  display: grid;
  place-items: center;
}

.opcao .caixa svg { width: 13px; height: 13px; stroke: #1a1006; stroke-width: 3; fill: none; opacity: 0; }
.opcao[aria-pressed="true"] { border-color: var(--marca); background: rgba(242, 160, 61, .12); }
.opcao[aria-pressed="true"] .caixa { background: var(--marca); border-color: var(--marca); }
.opcao[aria-pressed="true"] .caixa svg { opacity: 1; }

.painel-rodape {
  width: min(100%, 520px);
  margin: 22px auto 0;
}

.confirmar {
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--marca-forte), var(--marca));
  color: #1a1006;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.confirmar:disabled { opacity: .4; cursor: not-allowed; }

/* Campo que aparece quando a opção é "Outro". */
.aberto { width: min(100%, 520px); margin: 14px auto 0; display: flex; gap: 10px; }

/* ---------------------------------------------------------------- selado */

.selado {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--fundo) 72%, transparent);
  backdrop-filter: blur(6px);
  animation: aparecer .2s ease both;
}

@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

.selado-cartao {
  width: min(86vw, 300px);
  padding: 28px 24px 22px;
  background: #0c2534;
  border: 1px solid var(--borda-forte);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  text-align: center;
  animation: selar .38s cubic-bezier(.2, .9, .3, 1.3) both;
}

@keyframes selar {
  from { opacity: 0; transform: scale(.88); }
  to   { opacity: 1; transform: none; }
}

.selado-check {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
}

.selado-check svg { width: 24px; height: 24px; stroke: #0c2534; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.selado-valor { margin: 0; font-size: 1.02rem; font-weight: 600; }
.selado-risco { display: block; width: 48px; height: 1px; margin: 14px auto; background: var(--borda-forte); }
.selado-legenda { margin: 0; font-size: .78rem; color: var(--suave); }

/* ----------------------------------------------------------------- final */

.final { text-align: center; padding: 40px 0 10px; animation: subir .4s ease both; }
.final h2 { margin: 0 0 10px; font-size: 1.5rem; font-weight: 700; }
.final p  { margin: 0 auto; max-width: 42ch; color: var(--suave); }

/* ------------------------------------------------------------- telefones */

@media (max-width: 560px) {
  .palco { padding-bottom: 70px; }
  .bolha { max-width: 85%; }
  .marca-cat { display: none; }
  .trilha .fio { width: clamp(12px, 5.5vw, 34px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
