/* ==========================================================================
   Formulário Marp — uma pergunta por tela
   Tokens e fontes iguais aos do site da Marp (cores, Sora + Inter, raios).
   ========================================================================== */

@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-var-latin.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

:root {
  color-scheme: dark;

  --marp-green: #01B648;
  --green-hover: #14CC5C;
  --green-pressed: #019A3D;
  --green-soft: rgba(1, 182, 72, .12);
  --green-line: rgba(1, 182, 72, .35);

  --bg: #000000;
  --surface: #131317;
  --surface-raised: #1B1B21;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);

  --text: #FFFFFF;
  --text-2: #C4C1D0;
  --text-3: #8F8C9E;
  --error: #FF5C5C;

  --font-display: "Sora", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-inicio: clamp(1.5rem, 1.15rem + 1.6vw, 2.25rem);
  --fs-pergunta: clamp(1.5rem, 1.15rem + 1.6vw, 2.25rem);
  --fs-lead: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  --fs-campo: clamp(1.25rem, 1.05rem + .9vw, 1.75rem);
  --fs-small: .875rem;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --gutter: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 768px) { :root { --gutter: 32px; } }

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }
img, picture, svg { display: block; max-width: 100%; }
input, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(56rem 28rem at 88% -12%, rgba(1, 182, 72, .09), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--marp-green); text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--marp-green); outline-offset: 2px; }
.tela__titulo:focus, .tela__titulo:focus-visible { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.isca { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- moldura ---------- */

.progresso {
  position: fixed; inset: 0 0 auto; z-index: 10;
  height: 4px; background: var(--border);
}

.progresso__barra {
  display: block; height: 100%;
  background: var(--marp-green);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease);
}

.topo {
  position: absolute; top: 0; left: 0; z-index: 5;
  padding: 24px var(--gutter);
}

.topo__logo { width: 104px; height: auto; }

.palco {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 104px var(--gutter) 112px;
}

.navegacao {
  position: fixed; z-index: 5;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
}

.btn-voltar {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px 0 12px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface);
  color: var(--text-2); font-size: var(--fs-small); font-weight: 500;
  transition: background-color .2s, color .2s;
}

.btn-voltar:hover { background: var(--surface-raised); color: var(--text); }
.btn-voltar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- tela ---------- */

.tela {
  width: min(680px, 100%);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
}

.tela--entrando { opacity: 0; }
.tela--entrando.tela--frente { transform: translateY(28px); }
.tela--entrando.tela--tras { transform: translateY(-28px); }
.tela--saindo { opacity: 0; transition-duration: .2s; }
.tela--saindo.tela--frente { transform: translateY(-28px); }
.tela--saindo.tela--tras { transform: translateY(28px); }

.tela--erro .tela__controle { animation: tremer .32s var(--ease); }

@keyframes tremer {
  20% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  80% { transform: translateX(-3px); }
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--marp-green);
  font-size: .75rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
}

.tela__titulo {
  font-family: var(--font-display);
  font-size: var(--fs-pergunta);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  text-wrap: balance;
}

/* Tela de início: logo grande, título em caixa alta e destaques com a seta da marca */
.topo { transition: opacity .3s; }
[data-tipo-tela="inicio"] .topo { opacity: 0; visibility: hidden; }

[data-tipo-tela="inicio"] .palco { padding-top: 48px; padding-bottom: 48px; }

.tela__logo {
  width: min(400px, 72vw, 60vh); height: auto;
  margin: 0 auto clamp(28px, 5vh, 48px);
}

.tela--inicio .tela__titulo {
  font-size: var(--fs-inicio);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
  text-transform: uppercase;
}

.destaques {
  display: grid; justify-items: center; gap: 8px;
  margin: 20px 0 0; padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: var(--fs-lead);
  line-height: 1.45;
}

.destaques li { display: flex; align-items: baseline; gap: 10px; max-width: 46ch; text-align: left; }

.destaques__seta {
  flex: none;
  width: 12px; height: 17px;
  fill: var(--marp-green);
  transform: translateY(2px);
}

.tela--inicio .tela__desc { margin-top: 20px; color: var(--text); }
.tela--inicio, .tela--fim { text-align: center; }
.tela--inicio .tela__acoes, .tela--fim .tela__acoes { justify-content: center; }
.tela--inicio .tela__desc, .tela--fim .tela__desc { margin-inline: auto; }

.tela__desc {
  max-width: 60ch;
  margin-top: 16px;
  color: var(--text-2);
  font-size: var(--fs-lead);
}

.tela__desc p + p { margin-top: 12px; }
.tela__desc strong { color: var(--text); font-weight: 600; }

.lista-numerada { display: grid; gap: 12px; padding-left: 1.4em; }
.lista-numerada li::marker { color: var(--marp-green); font-weight: 600; }

.tela__foto img {
  width: 112px; height: 140px; object-fit: cover; object-position: 50% 20%;
  margin-bottom: 24px;
  border: 1px solid var(--green-line); border-radius: var(--radius-lg);
}

/* Tela de apresentação: foto grande do Gabriel e texto grande centralizado */
.tela--apresentacao { text-align: center; }
.tela--apresentacao .tela__acoes { justify-content: center; }

.tela--apresentacao .tela__foto { width: min(520px, 100%); margin: 0 auto clamp(28px, 4vh, 40px); }

.tela--apresentacao .tela__foto img {
  width: 100%; height: auto;
  margin: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px var(--green-line), 0 12px 40px rgba(1, 182, 72, .08);
}

.tela--apresentacao .tela__foto--retrato img { aspect-ratio: 4 / 5; }
.tela--apresentacao .tela__foto:not(.tela__foto--retrato) img { object-fit: contain; }

.tela--apresentacao .tela__titulo { font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.5rem); }

.tela--apresentacao .tela__desc {
  max-width: 34ch;
  margin-inline: auto;
  margin-top: 20px;
  color: var(--text);
  font-size: clamp(1.25rem, 1.05rem + .9vw, 1.75rem);
  line-height: 1.4;
}

.tela--apresentacao .tela__desc p + p { margin-top: 1em; }
.tela--apresentacao .tela__desc strong { color: var(--marp-green); }
.tela__desc strong.negrito-branco { color: var(--text); font-weight: 700; }

.tela__controle { margin-top: 28px; }

.tela__erro {
  min-height: 1.6em;
  margin-top: 12px;
  color: var(--error);
  font-size: var(--fs-small); font-weight: 500;
}

.tela__erro:empty { min-height: 0; margin-top: 0; }

.tela__acoes {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  margin-top: 28px;
}

.tela__aviso {
  max-width: 56ch;
  margin-top: 16px;
  color: var(--text-3);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.aviso-teste {
  margin-top: 24px; padding: 10px 14px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  color: var(--text-3); font-size: var(--fs-small);
}

/* ---------- campos de texto ---------- */

.campo {
  display: block; width: 100%;
  padding: 8px 0 10px;
  border: 0; border-bottom: 2px solid var(--border-strong); border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-campo);
  line-height: 1.35;
  transition: border-color .2s;
}

.campo::placeholder { color: var(--text-3); opacity: 1; }
.campo:hover { border-bottom-color: rgba(255, 255, 255, .3); }
.campo:focus, .campo:focus-visible { outline: none; border-bottom-color: var(--marp-green); }
.campo[aria-invalid="true"] { border-bottom-color: var(--error); }

.campo--longo { resize: none; min-height: 3.2em; field-sizing: content; max-height: 40vh; }

/* ---------- escolha ---------- */

.opcoes { display: grid; gap: 10px; max-width: 480px; }

.opcao {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}

.opcao:hover { border-color: var(--green-line); background: var(--surface-raised); }
.opcao:has(:checked) { border-color: var(--marp-green); background: var(--green-soft); }
.opcao:has(:focus-visible) { outline: 2px solid var(--marp-green); outline-offset: 2px; }
.opcoes[aria-invalid="true"] .opcao { border-color: rgba(255, 92, 92, .6); }

.opcao input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.opcao__tecla {
  flex: none;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text-2); font-size: .75rem; font-weight: 600;
  transition: background-color .2s, color .2s, border-color .2s;
}

.opcao:has(:checked) .opcao__tecla { border-color: var(--marp-green); background: var(--marp-green); color: #000; }

.opcao__rotulo { flex: 1; font-size: 1.0625rem; line-height: 1.35; }

.opcao__check {
  flex: none; width: 20px; height: 20px;
  fill: none; stroke: var(--marp-green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: scale(.6);
  transition: opacity .2s, transform .2s var(--ease);
}

.opcao:has(:checked) .opcao__check { opacity: 1; transform: none; }

/* ---------- consentimento ---------- */

.aceite {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  max-width: 560px;
  color: var(--text-2); font-size: 1rem;
  cursor: pointer;
}

.aceite input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.aceite__caixa {
  flex: none;
  display: grid; place-items: center;
  width: 24px; height: 24px; margin-top: 1px;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface);
  transition: background-color .2s, border-color .2s;
}

.aceite__caixa svg { width: 16px; height: 16px; fill: none; stroke: #000; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.aceite:has(:checked) .aceite__caixa { border-color: var(--marp-green); background: var(--marp-green); }
.aceite:has(:checked) .aceite__caixa svg { opacity: 1; }
.aceite:has(:focus-visible) .aceite__caixa { outline: 2px solid var(--marp-green); outline-offset: 2px; }
.aceite:has([aria-invalid="true"]) .aceite__caixa { border-color: var(--error); }

/* ---------- botões ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border-radius: var(--radius-md);
  font-weight: 600; text-decoration: none;
  transition: background-color .2s, border-color .2s;
}

.btn--primary { background: var(--marp-green); color: #000; }
.btn--primary:hover { background: var(--green-hover); }
.btn--primary:active { background: var(--green-pressed); }
.btn--secundario { border: 1px solid var(--border-strong); color: var(--text); }
.btn--secundario:hover { background: var(--surface-raised); }
.btn[aria-busy="true"] { cursor: progress; opacity: .8; }

.btn__icone {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s var(--ease);
}

.btn:hover .btn__icone { transform: translateX(4px); }

.dica-teclado { color: var(--text-3); font-size: var(--fs-small); }
.dica-teclado--campo { margin-top: 8px; }
.dica-teclado kbd { color: var(--text-2); font-family: inherit; font-weight: 600; }

@media (pointer: coarse) {
  .dica-teclado { display: none; }
}

@media (min-width: 768px) {
  .topo__logo { width: 120px; }
  .btn { min-height: 52px; padding: 0 28px; }
}

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