/* =========================================================
   Titular ou Suplente? — Landing + Quiz
   Estilos próprios. Usa os tokens de tokens.css.
   Display em Manrope (proxy de ClanOT enquanto não houver
   ficheiros licenciados — regra do design system do Factory).
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap');

:root {
  /* Proxy de display: Manrope até existir ClanOT em /fonts */
  --font-display: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display-narrow: 'Manrope', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--fg);
  background: var(--bg-site);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
@media (max-width: 720px) { .wrap { padding-inline: var(--gutter-sm); } }

/* ---------- Eyebrow / display helpers ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tk-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ''; width: 32px; height: 1px; background: currentColor; }
.eyebrow.on-dark { color: var(--fy-orange); }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: var(--tk-h1); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 88px; display: flex; align-items: center;
  background: rgba(244, 239, 232, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 2px solid var(--accent);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-seal { height: 42px; width: 42px; }
.brand-word { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.5px; color: var(--fy-teal); line-height: 1; }
.brand-word em { font-style: normal; font-weight: 500; color: var(--fy-teal-60); }
.topbar .meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-faint); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 13px; letter-spacing: var(--tk-meta);
  text-transform: uppercase;
  border: none; cursor: pointer;
  padding: 16px 28px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 10px;
  transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-orange); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255,123,3,0.28); }
.btn-primary:active { transform: none; transition: var(--dur-1); }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- Hero ---------- */
.hero {
  background: var(--fy-orange);
  color: var(--fy-teal);
  padding-block: var(--s-10) var(--s-9);
  position: relative; overflow: hidden;
}
.hero .seal-bg {
  position: absolute; right: -80px; top: 50%; transform: translateY(-50%);
  width: 460px; opacity: 0.14; mix-blend-mode: multiply; pointer-events: none;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(40px, 7vw, var(--fs-display));
  line-height: var(--lh-tight); letter-spacing: var(--tk-display);
  color: var(--fy-teal); max-width: 10em; margin-top: var(--s-5);
}
.hero .lede {
  font-weight: 400; font-size: clamp(17px, 2.4vw, 20px); line-height: 1.5;
  color: rgba(6, 41, 52, 0.82); max-width: 52ch; margin-top: var(--s-5);
}
.hero .cta-row { margin-top: var(--s-7); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hero .reassure { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: rgba(6, 41, 52, 0.6); }
.hero .eyebrow.on-dark { color: var(--fy-teal); }
.hero .eyebrow.on-dark::before { background: var(--fy-teal); }
.hero .btn-primary { background: var(--fy-teal); color: #fff; box-shadow: 0 8px 24px rgba(6,41,52,0.22); }
.hero .btn-primary:hover { background: #0a3947; box-shadow: 0 12px 32px rgba(6,41,52,0.28); }

/* ---------- Proof strip ---------- */
.proof-strip { background: var(--fy-off-white); border-bottom: 1px solid var(--border); padding-block: 18px; }
.proof-strip .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; }
.proof-strip span {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta);
  text-transform: uppercase; color: var(--fg-muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.proof-strip span:not(:first-child)::before { content: ''; width: 4px; height: 4px; border-radius: 999px; background: var(--accent); }

/* ---------- Section frame ---------- */
.section { padding-block: var(--s-9); }
.section.cream { background: var(--fy-cream); }

/* ---------- Quiz shell ---------- */
.quiz-shell { max-width: 760px; margin: 0 auto; }

.card {
  background: var(--fy-white);
  border: 1px solid var(--fy-teal-08);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 48px;
}
@media (max-width: 720px) { .card { padding: 24px; } }

/* progress */
.progress { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.progress .bar { flex: 1; height: 4px; background: var(--fy-teal-08); border-radius: var(--r-pill); overflow: hidden; }
.progress .bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width var(--dur-3) var(--ease); }
.progress .count { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); color: var(--fg-faint); text-transform: uppercase; }

.q-eyebrow { margin-bottom: 14px; }
.q-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(22px, 3.4vw, 30px); line-height: 1.12; letter-spacing: var(--tk-h2);
  color: var(--fg); margin-bottom: 28px;
}

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  text-align: left; width: 100%;
  font-family: var(--font-body); font-size: 16px; line-height: 1.4; color: var(--fg);
  background: var(--fy-white);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 18px 20px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.option:hover { border-color: var(--accent); background: var(--fy-orange-tint); }
.option:active { transform: scale(0.995); }
.option .dot {
  flex: none; width: 20px; height: 20px; border-radius: var(--r-pill);
  border: 2px solid var(--fy-teal-20); transition: border-color var(--dur-2) var(--ease);
}
.option:hover .dot { border-color: var(--accent); }

.nav-row { margin-top: 28px; display: flex; justify-content: space-between; align-items: center; }
.back-link { background: none; border: none; cursor: pointer; font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-faint); }
.back-link:hover { color: var(--accent); }
.back-link[hidden] { visibility: hidden; }

/* ---------- Fork ---------- */
.fork { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .fork { grid-template-columns: 1fr; } }
.fork .option { flex-direction: column; align-items: flex-start; gap: 8px; padding: 28px; }
.fork .option strong { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.fork .option span { color: var(--fg-muted); font-size: 15px; }

/* ---------- Email gate ---------- */
.gate-fields { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.gate-fields input[type=text], .gate-fields input[type=email] {
  font-family: var(--font-body); font-size: 16px; color: var(--fg);
  padding: 16px 18px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--fy-white);
}
.gate-fields input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: transparent; }
.gate-consent { font-size: 13px; color: var(--fg-muted); line-height: 1.5; }

/* ---------- Result ---------- */
.result-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.score-block { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.score-badge {
  flex: none; width: 104px; height: 104px; border-radius: var(--r-pill);
  background: var(--fy-orange); color: #fff; display: grid; place-items: center; text-align: center;
  box-shadow: var(--shadow-orange);
}
.score-badge b { font-family: var(--font-display); font-weight: 800; font-size: 38px; line-height: 1; }
.score-badge small { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.5px; color: rgba(255,255,255,0.85); margin-top: 2px; }
.score-caption { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-faint); }
.status-pill {
  font-family: var(--font-mono); font-weight: 700; font-size: 12px; letter-spacing: var(--tk-meta); text-transform: uppercase;
  padding: 8px 16px; border-radius: var(--r-pill); display: inline-block;
}
.status-pill.suplente { background: var(--fy-orange-soft); color: var(--fy-orange-deep); }
.status-pill.titular { background: var(--fy-green); color: #04361f; }
.result-position { font-family: var(--font-mono); font-size: 12px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-faint); margin-top: 18px; }
.result-verdict { font-family: var(--font-display); font-weight: 800; font-size: clamp(24px,4vw,34px); line-height: 1.1; letter-spacing: var(--tk-h2); margin: 6px 0 16px; }
.result-body { font-size: 17px; line-height: 1.6; color: var(--fg); max-width: 56ch; }
.result-course {
  margin-top: 28px; padding: 24px; border-radius: var(--r-md);
  background: var(--fy-cream); border: 1px solid var(--fy-teal-08);
}
.result-course .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-faint); }
.result-course .name { font-family: var(--font-display); font-weight: 800; font-size: 22px; margin: 6px 0 4px; }
.result-course .coupon { margin-top: 10px; font-size: 15px; color: var(--fg-muted); }
.result-course .coupon code { font-family: var(--font-mono); font-weight: 700; background: var(--fy-white); border: 1px dashed var(--fy-orange); color: var(--fy-orange-deep); padding: 2px 8px; border-radius: var(--r-sm); }
.result-cta { margin-top: 24px; }
.result-foot { margin-top: 22px; font-size: 13px; color: var(--fg-faint); }

/* blocos de leitura do resultado (o que isto diz / onde perdes jogo) */
.result-read { margin-top: 24px; }
.result-read .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-faint); }
.result-read p { font-size: 17px; line-height: 1.6; color: var(--fg); margin-top: 8px; max-width: 58ch; }

/* hybrid note */
.result-hybrid {
  margin-top: 16px; padding: 16px 18px; border-left: 3px solid var(--accent);
  background: var(--fy-orange-tint); border-radius: var(--r-sm);
  font-size: 15px; line-height: 1.55; color: var(--fg);
}

/* training plan */
.training { margin-top: 28px; }
.training .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-faint); }
.training ol { margin: 14px 0 0; padding-left: 0; counter-reset: tp; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.training li { position: relative; padding-left: 44px; font-size: 16px; line-height: 1.5; }
.training li::before {
  counter-increment: tp; content: counter(tp);
  position: absolute; left: 0; top: -2px;
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--fy-teal); color: #fff;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}

/* share card block */
.share-block { margin-top: 28px; padding: 24px; border-radius: var(--r-md); background: var(--fy-teal); }
.share-ego { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.3; color: #fff; margin-bottom: 16px; max-width: 48ch; }
.share-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-block .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.25); }
.share-block .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.share-hint { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-faint); }

/* consent checkbox */
.gate-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--fg-muted); line-height: 1.5; cursor: pointer; }
.gate-check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.gate-consent a { color: var(--accent); }

/* result proof (lista de frases concretas) */
.result-proof-block { margin-top: 28px; }
.result-proof-block .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-faint); }
.result-proof { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding: 0; }
.result-proof li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.45; color: var(--fg); }
.result-proof li::before { content: ''; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }

/* oferta (desconto no fim) */
.result-offer { margin-top: 28px; padding: 24px; border-radius: var(--r-md); background: var(--fy-cream); border: 1px solid var(--fy-teal-08); }
.result-offer .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--accent); }
.result-offer p { font-size: 16px; line-height: 1.55; color: var(--fg); margin: 10px 0 18px; }
.result-offer code { font-family: var(--font-mono); font-weight: 700; background: var(--fy-white); border: 1px dashed var(--fy-orange); color: var(--fy-orange-deep); padding: 2px 8px; border-radius: var(--r-sm); }

/* notas de funil */
.fork-note { margin-top: 22px; font-size: 13px; line-height: 1.5; color: var(--fg-muted); }
.gate-proof { margin-top: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-faint); }

/* ---------- Footer ---------- */
.footer { background: var(--fy-teal); color: var(--fg-inverse-muted); padding-block: var(--s-7); margin-top: var(--s-9); }
.footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer img { height: 28px; }
.footer .tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; }

/* ---------- Micro-feedback inline (acima da pergunta seguinte) ---------- */
.q-feedback {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: var(--tk-meta);
  color: var(--accent); line-height: 1.4; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.q-feedback::before { content: ''; flex: none; width: 16px; height: 2px; background: var(--accent); margin-top: 8px; }

/* ---------- Resultado enxuto: diagnóstico, oferta, prova colapsada ---------- */
.result-diagnosis { font-size: 18px; line-height: 1.55; color: var(--fg); margin-top: 14px; max-width: 56ch; }
.offer-coupon { font-size: 15px; color: var(--fg-muted); margin: 12px 0 18px; }
.result-proof-details { margin-top: 24px; }
.result-proof-details summary { font-family: var(--font-mono); font-size: 12px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--accent); cursor: pointer; }
.result-proof-details[open] summary { margin-bottom: 8px; }

/* ---------- Loader ---------- */
.loader-card { text-align: center; }
.spinner {
  width: 56px; height: 56px; margin: 0 auto 24px;
  border: 4px solid var(--fy-teal-08);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Títulos das secções do resultado (mais visíveis: maiores e laranja) ---------- */
#screen-result .label,
#screen-result .result-position {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

/* ---------- Resultado v2 (índice, descrição, scores, gate, confirmação) ---------- */
#screen-result .result-position {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(24px, 4vw, 32px); line-height: 1.1; letter-spacing: var(--tk-h2);
  text-transform: none; color: var(--fg); margin-top: 16px;
}
.result-desc { font-size: 18px; line-height: 1.55; color: var(--fg); margin-top: 12px; max-width: 58ch; }
.result-ialevel { margin-top: 14px; display: inline-block; font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-muted); background: var(--fy-teal-04); border: 1px solid var(--border); padding: 6px 12px; border-radius: var(--r-pill); }

.result-stats-block { margin-top: 28px; }
.result-stats { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.stat-row { display: grid; grid-template-columns: 120px 1fr 40px; align-items: center; gap: 14px; }
.stat-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: var(--tk-meta); text-transform: uppercase; color: var(--fg-muted); }
.stat-track { height: 10px; background: var(--fy-teal-08); border-radius: 999px; overflow: hidden; }
.stat-fill { display: block; height: 100%; background: var(--fy-teal-40); border-radius: 999px; transition: width var(--dur-3) var(--ease); }
.stat-val { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--fg); text-align: right; }
.stat-row.is-primary .stat-label, .stat-row.is-primary .stat-val { color: var(--accent); }
.stat-row.is-primary .stat-fill { background: var(--accent); }

.result-gate { margin-top: 32px; padding: 28px; border-radius: var(--r-lg); background: var(--fy-orange-tint); border: 1px solid var(--fy-orange-soft); color: var(--fg); }
.gate-title { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.2; color: var(--fy-teal); margin: 12px 0 16px; }
.gate-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 10px; }
.gate-list li { position: relative; padding-left: 28px; font-size: 15px; line-height: 1.45; color: var(--fg-muted); }
.gate-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border-radius: 999px; background: var(--fy-orange); }
.result-gate .gate-proof { color: var(--fg-faint); margin-bottom: 18px; }
.result-gate .gate-fields input[type=text], .result-gate .gate-fields input[type=email] { background: var(--fy-white); border-color: var(--border-strong); color: var(--fg); }
.result-gate .gate-check { color: var(--fg-muted); }
.result-gate .gate-consent { color: var(--fg-muted); }
.result-gate .gate-consent a { color: var(--accent); }

.result-confirm { margin-top: 28px; }
.result-confirm .gate-title { color: var(--fg); }

/* ---------- Animação do header (acento à direita) ---------- */
.hero-anim {
  /* Ancorada ao centro da página: o texto (wrap 1240 + H1 10em) termina
     sempre antes de 50% + 180px, independentemente da fonte carregada */
  position: absolute; top: 50%; transform: translateY(-50%);
  left: max(calc(50% + 200px), 700px); right: -20px;
  pointer-events: none; z-index: 0;
}
.hero-anim svg { width: 100%; max-width: 720px; height: auto; display: block; overflow: visible; margin-left: auto; }
.hero .wrap { position: relative; z-index: 1; }

/* Em portáteis o gráfico renderiza a ~70-80% da escala de desenho:
   compensar o tamanho das labels para manterem ~10-11px efectivos */
@media (max-width: 1680px) {
  .hero-anim { right: 16px; }
  .hero-anim .label { font-size: 14px; }
  .hero-anim .sub-label { font-size: 11.5px; }
}

/* Abaixo de 1280px reduzir a escala do texto para dar espaço à animação */
@media (max-width: 1280px) and (min-width: 1201px) {
  .hero h1 { font-size: clamp(36px, 5vw, 60px); }
  .hero .lede { max-width: 44ch; }
}

/* Ecrãs baixos (13'' ≈ 800px úteis): reduzir o padding vertical do hero
   para o CTA ficar acima da dobra */
@media (max-height: 860px) and (min-width: 901px) {
  .hero { padding-block: var(--s-9) var(--s-8); }
}

/* Abaixo de 1200px a animação ficaria demasiado pequena: esconder */
@media (max-width: 1200px) { .hero-anim { display: none; } }

@keyframes fyBgIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fyDraw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes fyEntUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fyEntRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fyEntDown { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fyArrive { 0% { opacity: 0.5; transform: scale(0.5); } 80% { opacity: 0; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes fyBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes fyNode { 0%, 100% { opacity: 0.1; } 50% { opacity: 0.7; } }
@keyframes fyCometCore { 0% { stroke-dashoffset: 118; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { stroke-dashoffset: -18; opacity: 0; } }
@keyframes fyCometGlow { 0% { stroke-dashoffset: 118; opacity: 0; } 12% { opacity: 0.3; } 88% { opacity: 0.3; } 100% { stroke-dashoffset: -18; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-anim [data-anim] { animation: none !important; } }

/* ---------- Screen toggling ---------- */
.screen[hidden] { display: none; }
.screen { animation: fade var(--dur-3) var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
