/* ============================================================
   FFC — /forms/ · Design system compartilhado dos formulários
   ------------------------------------------------------------
   Tokens clonados do tema do forms.app usado pela FFC (dark,
   Space Grotesk, accent azul). Usado por todos os forms da
   família; o conteúdo de cada um vem de data/form.json.
   ============================================================ */

@font-face {
  font-family: 'Space Grotesk';
  src: url('SpaceGrotesk-VariableFont_wght.woff2') format('woff2'),
       url('SpaceGrotesk-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #191A2E;
  --card: #1f2036;
  --input: #070713;
  --border: #303143;
  --accent: #2500f5;
  --accent-soft: #4b34f7;
  --text: #CFCFD5;
  --text-strong: #ffffff;
  --error: #ff8a8a;
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
}

main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ─── Barra de progresso ───────────────────────────────────── */
.ff-progress {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 6px;
  background: var(--border);
}
.ff-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent-soft);
  transition: width .3s ease;
}

/* ─── Card (welcome / pergunta / obrigado) ─────────────────── */
.ff-card { animation: ff-slide .35s ease; }
@keyframes ff-slide {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.ff-emoji { font-size: 3rem; line-height: 1.2; margin-bottom: 12px; }

.ff-card h1, .ff-card h2 {
  color: var(--text-strong);
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.3;
}
.ff-card h1 { font-size: 1.6rem; }
.ff-card h2 { font-size: 1.3rem; }
.ff-card p { margin-bottom: 12px; }
.ff-card p:last-child { margin-bottom: 0; }

.ff-qnum { font-size: .9rem; color: var(--accent-soft); font-weight: 600; margin-bottom: 6px; }

.ff-label {
  display: block;
  font-size: 1.25rem;
  color: var(--text-strong);
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.35;
}
.ff-hint { font-size: .9rem; margin-bottom: 14px; }
.ff-optional { font-size: .85rem; color: var(--text); opacity: .7; }

/* ─── Inputs ───────────────────────────────────────────────── */
.ff-field { margin: 18px 0 6px; }
.ff-field + .ff-field { margin-top: 12px; }
.ff-sublabel { display: block; font-size: .85rem; margin-bottom: 6px; }

input[type="text"],
input[type="email"] {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text-strong);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder { color: #6a6b80; }
input:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
  border-color: var(--accent-soft);
}

/* ─── Opções (single = radio, multi = checkbox) ───────────── */
.ff-options { list-style: none; margin: 18px 0 6px; }
.ff-options li + li { margin-top: 10px; }
.ff-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  cursor: pointer;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.ff-option:hover { border-color: var(--accent-soft); }
.ff-option input { accent-color: var(--accent-soft); width: 18px; height: 18px; flex: none; }
.ff-option.is-checked {
  border-color: var(--accent-soft);
  background: #10102a;
  color: var(--text-strong);
}
.ff-option:focus-within { outline: 2px solid var(--accent-soft); outline-offset: 1px; }

/* ─── Consentimento ────────────────────────────────────────── */
.ff-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-size: .88rem;
  cursor: pointer;
}
.ff-consent input { accent-color: var(--accent-soft); width: 17px; height: 17px; flex: none; margin-top: 2px; }
.ff-consent a { color: var(--accent-soft); }

/* ─── Botões / navegação ───────────────────────────────────── */
.ff-nav { display: flex; align-items: center; gap: 14px; margin-top: 22px; }

.ff-btn {
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  padding: 13px 28px;
  cursor: pointer;
  transition: background .15s ease;
}
.ff-btn:hover { background: var(--accent-soft); }
.ff-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ff-btn[disabled] { opacity: .55; cursor: wait; }
a.ff-btn { display: inline-block; text-decoration: none; }

.ff-back {
  font: inherit;
  font-size: .95rem;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  padding: 8px 4px;
}
.ff-back:hover { color: var(--text-strong); }
.ff-back:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

/* ─── Erro / status ────────────────────────────────────────── */
.ff-error { color: var(--error); font-size: .92rem; min-height: 1.4em; margin-top: 10px; }

/* ─── Rodapé ───────────────────────────────────────────────── */
.ff-footer {
  text-align: center;
  font-size: .8rem;
  opacity: .6;
  padding: 16px 20px 24px;
}
.ff-footer a { color: inherit; }

/* ─── Acessibilidade / preferências ────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .ff-card { animation: none; }
  .ff-progress > span { transition: none; }
}
