/* ============================================================
   Consultório Previsível — Candidatura
   Editorial claro · head serif (Fraunces) + perguntas Baloo 2 + Inter
   Acento bronze. Numeração grande estilo revista.
   ============================================================ */

:root {
  --bg:        #f0e9db;   /* papel / marfim quente */
  --paper:     #fbf7ef;
  --ink:       #211d16;   /* tinta quente, quase preto */
  --ink-soft:  #5d574b;
  --ink-faint: #97907f;
  --line:      #ddd2bd;
  --line-soft: #e8dfcc;

  --bronze:    #a3763c;   /* acento (fora da paleta, casa com a marca) */
  --bronze-dp: #855e2c;
  --bronze-sf: #ece0c8;

  --radius:    4px;       /* cantos discretos = menos "app", mais editorial */
  --radius-lg: 10px;
  --maxw:      680px;
  --shadow:    0 30px 60px -34px rgba(70, 50, 20, .4);
  --shadow-sm: 0 12px 30px -20px rgba(70, 50, 20, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 100% -10%, rgba(163, 118, 60, .10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.62;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; min-height: 100dvh;
}
/* Textura de papel bem sutil */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .035; mix-blend-mode: multiply;
}

/* Serif nas headlines; Baloo nas perguntas */
.welcome__title, .thankyou__title { font-family: 'Fraunces', Georgia, serif; font-weight: 600; line-height: 1.08; letter-spacing: -.01em; }
.q__title { font-family: 'Baloo 2', 'Inter', sans-serif; font-weight: 600; line-height: 1.18; letter-spacing: -.005em; }
strong { font-weight: 600; color: var(--ink); }

/* ---------- Palco / telas ---------- */
.stage { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }
.screen {
  position: absolute; inset: 0; display: none;
  align-items: flex-start; justify-content: center;
  padding: 104px 26px 76px; overflow-y: auto;
}
.screen.is-active { display: flex; animation: stepIn .5s cubic-bezier(.22,.61,.36,1); }
@keyframes stepIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.welcome__inner, .q, .thankyou__inner { width: 100%; max-width: var(--maxw); margin: auto 0; }

/* ---------- Marca ---------- */
.brandline { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; }
.brandline__logo { width: 32px; height: 32px; border-radius: 7px; }
.brandline__name { font-weight: 600; font-size: .98rem; color: var(--ink); letter-spacing: .02em; }

.eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--bronze-dp);
  margin-bottom: 20px; padding-bottom: 4px; border-bottom: 1px solid var(--bronze);
}

/* ---------- Abertura ---------- */
.welcome__title { font-size: clamp(2.6rem, 7vw, 4.1rem); margin-bottom: 24px; }
.welcome__lead { font-size: clamp(1.12rem, 2.4vw, 1.35rem); color: var(--ink); margin-bottom: 18px; }
.welcome__text { color: var(--ink-soft); margin-bottom: 30px; }

.notes {
  list-style: none; display: grid;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 4px 6px; margin-bottom: 28px; box-shadow: var(--shadow-sm);
}
.notes li {
  position: relative; padding: 15px 18px 15px 42px; font-size: .95rem; color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
}
.notes li:last-child { border-bottom: none; }
.notes li::before {
  content: ''; position: absolute; left: 18px; top: 22px; width: 14px; height: 1.5px; background: var(--bronze);
}

.welcome__close {
  font-family: 'Fraunces', serif; font-style: italic; font-weight: 500;
  font-size: 1.24rem; color: var(--ink); margin-bottom: 34px;
}
.meta-line { margin-top: 16px; font-size: .84rem; color: var(--ink-faint); letter-spacing: .04em; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 1.02rem;
  border: none; border-radius: 100px; cursor: pointer;
  padding: 16px 36px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn--primary { background: var(--ink); color: var(--bg); box-shadow: 0 16px 32px -16px rgba(33, 29, 22, .7); }
.btn--primary:hover { transform: translateY(-2px); background: #100e0a; }
.btn .ent { font-size: .8rem; opacity: .6; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 1px 6px; }

/* ---------- Pergunta (numeração editorial) ---------- */
.q__head {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.q__num { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(2rem, 5.5vw, 3rem); line-height: .8; color: var(--bronze); }
.q__of { font-size: .8rem; color: var(--ink-faint); letter-spacing: .08em; text-transform: uppercase; }
.q__title { font-size: clamp(1.6rem, 3.9vw, 2.35rem); color: var(--ink); margin-bottom: 8px; }
.q__hint { color: var(--ink-soft); font-size: .96rem; margin-bottom: 26px; }
.q__title + .options { margin-top: 28px; }

/* ---------- Opções ---------- */
.options { display: grid; gap: 10px; }
.opt {
  position: relative; display: flex; align-items: center; gap: 16px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px 20px; cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .12s ease, box-shadow .16s ease;
}
.opt:hover { border-color: var(--bronze); transform: translateX(3px); box-shadow: var(--shadow-sm); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__key {
  flex-shrink: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 1rem; color: var(--ink-faint);
  border-right: 1px solid var(--line); padding-right: 16px; transition: color .16s ease;
}
.opt__label { font-size: 1rem; color: var(--ink); }
.opt:has(input:checked) { border-color: var(--bronze); background: var(--bronze-sf); }
.opt:has(input:checked) .opt__key { color: var(--bronze-dp); border-color: var(--bronze); }

.reveal-field { margin-top: 12px; }
.reveal-field[hidden] { display: none; }

/* ---------- Inputs / textarea ---------- */
.textarea, .reveal-field input, .field input {
  width: 100%; font-family: 'Inter', sans-serif; font-size: 1.05rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 18px; transition: border-color .16s ease, box-shadow .16s ease; resize: vertical;
}
.textarea:focus, .reveal-field input:focus, .field input:focus {
  outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px rgba(163, 118, 60, .14);
}
.textarea::placeholder, input::placeholder { color: var(--ink-faint); }

.fields { display: grid; gap: 20px; margin: 28px 0 6px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: .95rem; font-weight: 600; color: var(--ink); }
.field__sub { font-size: .82rem; color: var(--ink-faint); margin-top: -2px; }

/* ---------- Navegação ---------- */
.step__nav { margin-top: 32px; }
.privacy { margin-top: 22px; font-size: .82rem; color: var(--ink-faint); }

/* ---------- Progresso ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--line-soft); z-index: 50; opacity: 0; transition: opacity .3s ease; }
.progress.is-visible { opacity: 1; }
.progress span { display: block; height: 100%; width: 0; background: var(--bronze); transition: width .45s cubic-bezier(.22,.61,.36,1); }

/* ---------- Voltar ---------- */
.back {
  position: fixed; top: 20px; left: 22px; z-index: 50; display: none; align-items: center; gap: 6px;
  background: transparent; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: .9rem; font-weight: 500; color: var(--ink-soft);
  padding: 8px 12px; border-radius: 100px; transition: background .16s ease, color .16s ease;
}
.back:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.back.is-visible { display: inline-flex; }

/* ---------- Tela final ---------- */
.thankyou { text-align: center; }
.thankyou__mark {
  width: 72px; height: 72px; margin: 0 auto 28px; border-radius: 50%;
  border: 1.5px solid var(--bronze); color: var(--bronze-dp); font-family: 'Fraunces', serif;
  font-size: 2rem; display: flex; align-items: center; justify-content: center; background: var(--paper);
}
.thankyou__title { font-size: clamp(2rem, 4.6vw, 2.8rem); margin-bottom: 18px; }
.thankyou__text { color: var(--ink-soft); font-size: 1.08rem; max-width: 540px; margin: 0 auto; }

/* ---------- Erros ---------- */
.submit-error { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #a3423f; color: #fff; padding: 13px 22px; border-radius: 100px; font-size: .92rem; font-weight: 500; box-shadow: var(--shadow); z-index: 60; }
.submit-error[hidden] { display: none; }
.options.invalid .opt, .invalid.textarea, .field input.invalid { border-color: #c76b62; }
.field-error { color: #a3423f; font-size: .84rem; margin-top: 10px; }

/* ---------- Responsivo ---------- */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .screen { padding: 84px 20px 52px; }
  .btn { width: 100%; justify-content: center; }
  .opt { padding: 15px 16px; gap: 13px; }
  .opt:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
