/* =========================================================
   Isabela Vicarpi · formulário de aplicação (/formulario/)
   Uma pergunta por tela, como no typeform, com a identidade do Leveza Criativa.
   Só as 4 cores da ID: off-white #FFF4ED · terracota #833102 · oliva #665F29 · amarelo #F1E761 (só destaque, nunca fundo)
   Texto em Neue Montreal; a Melodrame só numa palavra de destaque; post-it em Sticky Notes. Nada em caixa alta.
   ========================================================= */

@font-face{font-family:"Melodrame";src:url(fonts/melodrame.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"NeueMontreal";src:url(fonts/neuemontreal-regular.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"NeueMontreal";src:url(fonts/neuemontreal-bold.woff2) format("woff2");font-weight:700;font-display:swap}
@font-face{font-family:"StickyNotes";src:url(fonts/sticky-notes.woff2) format("woff2");font-weight:400;font-display:swap}

:root {
  --terracota: #833102;
  --oliva: #665F29;
  --amarelo: #F1E761;
  --papel: #FFF4ED;
  --tinta-2: rgba(131, 49, 2, .72);   /* texto de apoio no papel */
  --linha: rgba(131, 49, 2, .3);      /* bordas no papel */
  --f-texto: "NeueMontreal", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-destaque: "Melodrame", Georgia, serif;
  --f-mao: "StickyNotes", "Segoe Print", "Comic Sans MS", cursive;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; overflow: hidden;
  color: var(--terracota);
  font: 400 18px/1.5 var(--f-texto);
  -webkit-font-smoothing: antialiased;
  /* papel de caderno quadriculado, como o adesivo "criativa" da logo */
  background-color: var(--papel);
  background-image:
    linear-gradient(rgba(131, 49, 2, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(131, 49, 2, .055) 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: -1px -1px;
  transition: background-color .7s var(--ease);
}
/* abertura em terracota e agradecimento em oliva (sem o quadriculado) */
body[data-fundo="terracota"] { background-color: var(--terracota); background-image: none; color: var(--papel); }
body[data-fundo="oliva"] { background-color: var(--oliva); background-image: none; color: var(--papel); }

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px dashed var(--terracota); outline-offset: 4px; }
body[data-fundo] :focus-visible { outline-color: var(--amarelo); }
em { font-style: normal; }

/* ---------- topo: barra de progresso e contador ---------- */
.topo {
  position: fixed; inset: 0 0 auto; z-index: 5;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
body[data-fundo] .topo { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.barra { height: 4px; background: rgba(131, 49, 2, .12); }
.barra-cheia { display: block; height: 100%; width: 0; background: var(--terracota); border-radius: 0 4px 4px 0; transition: width .6s var(--ease); }
.topo-linha { display: flex; align-items: center; justify-content: flex-end; padding: 14px 18px; }
.contador { font-size: 14px; color: var(--tinta-2); font-variant-numeric: tabular-nums; }

/* ---------- telas: uma de cada vez ---------- */
.palco { position: relative; height: 100vh; height: 100dvh; }
.tela {
  position: absolute; inset: 0; display: none;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 96px 20px 120px;
}
.tela.ativa, .tela.saindo { display: flex; }
.tela > * { margin: auto; width: 100%; }
.tela.saindo { pointer-events: none; }

/* entrada e saída: sobe ao avançar, desce ao voltar */
.tela.entra-baixo > * { animation: entra-baixo .6s var(--ease) both; }
.tela.entra-cima > * { animation: entra-cima .6s var(--ease) both; }
.tela.sai-cima > * { animation: sai-cima .4s var(--ease) both; }
.tela.sai-baixo > * { animation: sai-baixo .4s var(--ease) both; }
@keyframes entra-baixo { from { opacity: 0; transform: translateY(48px); } to { opacity: 1; transform: none; } }
@keyframes entra-cima { from { opacity: 0; transform: translateY(-48px); } to { opacity: 1; transform: none; } }
@keyframes sai-cima { to { opacity: 0; transform: translateY(-48px); } }
@keyframes sai-baixo { to { opacity: 0; transform: translateY(48px); } }

/* ---------- botões ---------- */
.botao {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px 14px 24px; border-radius: 999px;
  background: var(--terracota); color: var(--papel);
  font-weight: 700; font-size: 17px; line-height: 1; text-decoration: none;
  transition: background-color .3s var(--ease), color .3s var(--ease), gap .3s var(--ease), transform .3s var(--ease);
}
.botao svg { width: 18px; height: 18px; }
.botao:hover, .botao:focus-visible { gap: 14px; transform: translateY(-2px); }
.botao--claro { background: var(--papel); color: var(--terracota); }
.botao--claro:hover, .botao--claro:focus-visible { background: var(--amarelo); }
/* botão principal da abertura: maior e com sombra, pra ser a primeira coisa que o olho acha */
.botao--grande {
  gap: 14px; padding: 20px 34px 20px 38px; font-size: 21px;
  box-shadow: 0 0 0 6px rgba(255, 244, 237, .18), 0 14px 32px rgba(40, 14, 0, .35);
}
.botao--grande svg { width: 22px; height: 22px; }
.botao--grande:hover, .botao--grande:focus-visible { gap: 18px; box-shadow: 0 0 0 10px rgba(241, 231, 97, .25), 0 18px 38px rgba(40, 14, 0, .4); }
.botao[disabled] { opacity: .6; cursor: wait; transform: none; }

/* ---------- abertura ---------- */
.abertura { max-width: 620px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.abertura-titulo { margin: 0 0 22px; font-weight: 400; font-size: clamp(34px, 6vw, 56px); line-height: 1.08; letter-spacing: -.035em; text-wrap: balance; }
.abertura-titulo em { font-family: var(--f-destaque); font-size: 1.3em; padding-inline: .08em; line-height: 1; letter-spacing: 0; color: var(--amarelo); }
.abertura-txt { margin: 0 0 12px; font-size: clamp(17px, 1.6vw, 19px); line-height: 1.5; color: rgba(255, 244, 237, .88); max-width: 46ch; }
.abertura-acao { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 26px; }
.tempo { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: rgba(255, 244, 237, .78); }
.tempo svg { width: 16px; height: 16px; }

/* ---------- pergunta ---------- */
.pergunta { max-width: 720px; }
.p-cab { position: relative; padding-left: 0; }
.p-num { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 15px; font-weight: 700; color: var(--terracota); }
.p-num svg { width: 15px; height: 15px; }
.p-titulo { margin: 0; font-weight: 400; font-size: clamp(25px, 3.6vw, 38px); line-height: 1.18; letter-spacing: -.025em; text-wrap: balance; }
.p-titulo em { font-family: var(--f-destaque); font-size: 1.3em; padding-inline: .08em; line-height: 1; letter-spacing: 0; }
.p-titulo .obr { color: var(--tinta-2); }
.p-desc { margin: 12px 0 0; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.45; color: var(--tinta-2); white-space: pre-line; }

.p-corpo { margin-top: 30px; }

/* campos de texto: só a linha de baixo, como no typeform */
.campo {
  display: block; width: 100%; padding: 8px 0 10px;
  border: 0; border-bottom: 2px solid var(--linha); border-radius: 0;
  background: transparent; color: var(--terracota);
  font: 400 clamp(21px, 2.8vw, 28px)/1.35 var(--f-texto); letter-spacing: -.01em;
  outline: none; transition: border-color .3s var(--ease);
}
.campo::placeholder { color: rgba(131, 49, 2, .32); }
.campo:focus { border-bottom-color: var(--terracota); }
textarea.campo { resize: none; overflow: hidden; min-height: 52px; }
.campo-ig { display: flex; align-items: baseline; gap: 2px; }
.campo-ig > span { font-size: clamp(21px, 2.8vw, 28px); color: var(--tinta-2); }

/* alternativas */
.opcoes { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; max-width: 560px; }
.opcao {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 16px 12px 12px; border-radius: 14px; text-align: left;
  background: rgba(255, 244, 237, .7); box-shadow: inset 0 0 0 1.5px var(--linha);
  font-size: 17px; line-height: 1.35; color: var(--terracota);
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.opcao:hover { background: rgba(131, 49, 2, .08); box-shadow: inset 0 0 0 1.5px var(--terracota); }
.letra {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px var(--linha); font-size: 14px; font-weight: 700; line-height: 1;
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.opcao-txt { flex: 1; }
.opcao-ok { flex: none; width: 20px; height: 20px; opacity: 0; transition: opacity .25s var(--ease); }
.opcao[aria-checked="true"] { background: var(--terracota); color: var(--papel); box-shadow: none; }
.opcao[aria-checked="true"] .letra { background: var(--amarelo); color: var(--terracota); box-shadow: none; }
.opcao[aria-checked="true"] .opcao-ok { opacity: 1; }
/* piscadinha ao escolher, antes de passar pra próxima */
.opcao.piscando { animation: piscar .45s steps(1) 1; }
@keyframes piscar { 0%, 50% { background: var(--terracota); } 25%, 75% { background: rgba(131, 49, 2, .55); } }

/* ok + dica do enter */
.p-acao { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 28px; }
.dica { font-size: 14px; color: var(--tinta-2); }
.dica b { font-weight: 700; }
.pular { font-size: 15px; color: var(--tinta-2); text-decoration: underline; text-underline-offset: 3px; }
.pular:hover { color: var(--terracota); }

/* aviso de campo: um bilhetinho terracota */
.erro {
  display: none; align-items: center; gap: 8px; margin-top: 16px;
  padding: 8px 14px; border-radius: 10px; width: fit-content;
  background: var(--terracota); color: var(--papel); font-size: 15px;
}
.erro.mostra { display: inline-flex; animation: tremer .4s var(--ease); }
@keyframes tremer { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* ---------- agradecimento ---------- */
.fim { max-width: 860px; display: grid; gap: 36px; justify-items: center; text-align: center; }
.fim-postit { position: relative; width: min(220px, 56vw); transform: rotate(-5deg); }
.fim-postit img { width: 100%; height: auto; filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .22)); }
.fim-postit span {
  position: absolute; inset: 20% 10% 10%; display: grid; place-items: center;
  font: 400 clamp(34px, 5vw, 44px)/1 var(--f-mao); color: var(--terracota);
}
.fim-titulo { margin: 0 0 14px; font-weight: 400; font-size: clamp(32px, 5vw, 54px); line-height: 1.1; letter-spacing: -.035em; text-wrap: balance; }
.fim-titulo em { font-family: var(--f-destaque); font-size: 1.3em; padding-inline: .08em; line-height: 1; letter-spacing: 0; color: var(--amarelo); }
.fim-sub { margin: 0 0 28px; font-size: clamp(17px, 1.7vw, 20px); color: rgba(255, 244, 237, .88); }
.fim .botao { white-space: normal; text-align: left; }
.ativa .fim-postit { animation: colar .9s .25s var(--ease) both; }
@keyframes colar { from { opacity: 0; transform: rotate(-14deg) translateY(-30px) scale(1.08); } to { opacity: 1; transform: rotate(-5deg); } }

/* ---------- setas ---------- */
.navega {
  position: fixed; right: 16px; bottom: 16px; z-index: 5; display: flex; gap: 2px;
  border-radius: 12px; overflow: hidden; box-shadow: 0 10px 24px rgba(131, 49, 2, .22);
  transition: opacity .4s var(--ease);
}
body[data-fundo] .navega { opacity: 0; pointer-events: none; }
.navega button { display: grid; place-items: center; width: 44px; height: 40px; background: var(--terracota); color: var(--papel); transition: background-color .25s var(--ease), color .25s var(--ease); }
.navega button:hover { background: var(--amarelo); color: var(--terracota); }
.navega button[disabled] { opacity: .45; cursor: default; background: var(--terracota); color: var(--papel); }
.navega svg { width: 20px; height: 20px; }
.navega .baixo { transform: rotate(180deg); }

/* ---------- computador ---------- */
@media (min-width: 760px) {
  .tela { padding: 110px 48px 120px; }
  .topo-linha { padding: 18px 32px; }
  .contador { font-size: 15px; }
  .p-num { position: absolute; right: calc(100% + 18px); top: .5em; margin: 0; white-space: nowrap; }
  .opcao { font-size: 18px; }
  .navega { right: 32px; bottom: 28px; }
  .fim { grid-template-columns: auto 1fr; text-align: left; justify-items: start; align-items: center; gap: 56px; }
  .fim-postit { width: 250px; }
}
/* tela baixa (celular deitado ou teclado aberto): menos respiro em cima */
@media (max-height: 560px) { .tela { padding-top: 72px; } }

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