/* ==========================================
   APLICAÇÃO METABOLISMO EM ORDEM · Dra. Monalisa
   Uma pergunta por tela (estilo Typeform), na identidade do guia de marca
   ========================================== */

:root {
  --font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-script: 'Sacramento', 'Segoe Script', 'Brush Script MT', cursive;

  --navy: #081B4D;
  --navy-2: #0B2466;
  --grafite: #272727;
  --cafe-2: #6B564F;
  --gold: #D0B273;
  --gold-dark: #8E7038;
  --gold-2: #E8D19B;
  --on-dark: #EDE7DF;
  --on-dark-muted: #B5AA9E;
  --on-dark-soft: rgba(237, 231, 223, 0.14);
  --on-dark-line: rgba(237, 231, 223, 0.32);
  --error: #F2A9A2;

  --grad-text: linear-gradient(100deg, #B8924A 0%, #EBD394 42%, #D0B273 62%, #B08A45 100%);
  --grad-btn: linear-gradient(100deg, #C9A55F, #E8D19B 55%, #D0B273);

  --r: 14px;
  --col: 760px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--on-dark);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2 { font-family: var(--font-heading); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance; }
input, button { font: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
fieldset { border: 0; min-width: 0; }
kbd { font-family: var(--font-body); font-size: 11px; border: 1px solid var(--on-dark-line); border-radius: 5px; padding: 1px 6px; margin: 0 2px; }
.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;
}

/* ==========================================
   PALCO · tela inteira, uma pergunta por vez
   ========================================== */

.stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 88% -5%, rgba(208, 178, 115, 0.18), transparent 60%),
    radial-gradient(760px 560px at 6% 105%, var(--navy-2), transparent 65%),
    var(--navy);
}
.stage__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(640px 380px at 50% 55%, rgba(208, 178, 115, 0.09), transparent 70%);
}
@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: scaleX(0.96); }
  50% { opacity: 1; transform: scaleX(1); }
}

/* ---------- topo: assinatura, etapa, progresso ---------- */
.topbar { position: relative; z-index: 2; }
.topbar__wrap {
  max-width: var(--col);
  margin: 0 auto;
  padding: 20px 24px 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.topbar__sig { font-family: var(--font-script); font-size: 26px; line-height: 1; color: var(--on-dark); }
.topbar__step {
  font-size: 14px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); white-space: nowrap; text-align: center;
}
.progress { height: 3px; background: var(--on-dark-soft); }
.progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #B8924A, #EBD394, #D0B273);
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- telas ---------- */
.wizard { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 32px 24px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* centra com margens automáticas, não com justify-content: assim, quando o conteúdo é mais alto
     que a janela, o topo não é cortado e dá para rolar até o fim */
  justify-content: flex-start;
  scrollbar-width: thin;
  scrollbar-color: rgba(208, 178, 115, 0.45) transparent;
}
.screen::-webkit-scrollbar { width: 6px; }
.screen::-webkit-scrollbar-thumb { background: rgba(208, 178, 115, 0.45); border-radius: 3px; }
.screen > :first-child { margin-top: auto; }
.screen > :last-child { margin-bottom: auto; }
.screen.is-active { display: flex; animation: slide-up 0.42s cubic-bezier(0.16, 1, 0.3, 1) both; }
.screen.is-leaving { animation: slide-out 0.22s ease-in both; }
@keyframes slide-up { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes slide-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-24px); } }

.kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold);
}
.kicker__n {
  font-family: var(--font-heading); font-size: 26px; font-weight: 600; letter-spacing: 0; line-height: 1;
  color: var(--gold-2);
}
.kicker__n::after { content: '→'; font-family: var(--font-body); font-size: 14px; margin-left: 8px; color: var(--gold); }

.sig { font-family: var(--font-script); font-size: clamp(32px, 4vw, 44px); line-height: 1; margin-top: -4px; }
.headline { font-size: clamp(42px, 7vw, 80px); max-width: 13ch; color: var(--on-dark); }
.headline .gold, .question em {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
}
@supports not (background-clip: text) { .headline .gold, .question em { color: var(--gold); } }
.question { font-size: clamp(32px, 5vw, 56px); font-weight: 500; max-width: 18ch; color: var(--on-dark); }
.lead { font-size: clamp(18px, 1.6vw, 21px); max-width: 48ch; color: var(--on-dark); }
.support, .help { font-size: 16px; color: var(--on-dark-muted); max-width: 48ch; margin-top: -8px; }
.micro { font-size: 14px; color: var(--on-dark-muted); }

/* ---------- campos: linha inferior, texto grande ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.field__label { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-dark-muted); }
.field__input {
  width: 100%;
  padding: 12px 0 14px;
  font-family: var(--font-heading);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--on-dark);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--on-dark-line);
  border-radius: 0;
  outline: none;
  caret-color: var(--gold);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--navy) inset;
  -webkit-text-fill-color: var(--on-dark);
  caret-color: var(--gold);
  transition: background-color 9999s ease-out 0s;
}
.field__input::placeholder { color: rgba(237, 231, 223, 0.38); font-style: italic; }
.field__input:focus { border-bottom-color: var(--gold); box-shadow: 0 2px 0 0 rgba(208, 178, 115, 0.35); }
.field__input--small { font-family: var(--font-body); font-size: 18px; font-weight: 400; padding: 10px 0 12px; }
.field__input--small::placeholder { font-style: normal; }
.field__error { display: none; font-size: 15px; font-weight: 500; color: var(--error); }
.field.is-error .field__input { border-bottom-color: var(--error); }
.field.is-error .field__error { display: block; }
.field--qual { margin-top: 2px; }
.field--qual[hidden] { display: none; }

/* intl-tel-input sobre o marinho */
.iti { width: 100%; }
.iti input.field__input { padding-left: 104px; }
.iti__country-list { z-index: 100; font-size: 16px; color: var(--grafite); }
.iti--separate-dial-code .iti__selected-dial-code { font-family: var(--font-body); font-size: 18px; color: var(--on-dark); }
.iti__selected-country { color: var(--on-dark); }
.iti__arrow { border-top-color: var(--on-dark-muted); }
.iti--separate-dial-code .iti__selected-country { background: transparent; }
.iti__selected-country:hover { background: rgba(237, 231, 223, 0.06); }

/* ==========================================
   OPÇÕES · letras A-G, alvos grandes
   ========================================== */

.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.opt {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  min-height: 60px;
  padding: 13px 16px;
  background: rgba(237, 231, 223, 0.05);
  border: 1.5px solid var(--on-dark-line);
  border-radius: var(--r);
  font-size: 18px; line-height: 1.35; color: var(--on-dark);
  cursor: pointer; user-select: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, color 0.15s;
}
.screen.is-active .opt { animation: slide-up 0.36s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: calc(var(--i, 0) * 45ms + 60ms); }
.opt__key {
  position: relative; flex: none;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(208, 178, 115, 0.8);
  border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--gold);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.opt--multi .opt__key { border-radius: 50%; }
.opt__check {
  position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px;
  fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 24; stroke-dashoffset: 24; opacity: 0;
}
.opt__text { flex: 1; }

@media (hover: hover) {
  .opt:hover { border-color: var(--gold); background: rgba(208, 178, 115, 0.10); }
}
.opt:active { transform: scale(0.99); }

.opt:has(input:checked), .opt.is-checked { background: var(--gold); border-color: var(--gold); color: var(--grafite); }
.opt:has(input:checked) .opt__key, .opt.is-checked .opt__key { background: var(--grafite); border-color: var(--grafite); color: var(--gold); }
.opt--multi:has(input:checked) .opt__letter, .opt--multi.is-checked .opt__letter { opacity: 0; }
.opt--multi:has(input:checked) .opt__check, .opt--multi.is-checked .opt__check { opacity: 1; animation: draw 0.22s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.opt:has(input:focus-visible), .opt.is-focus { outline: 3px solid var(--gold); outline-offset: 3px; }

.opts__error { display: none; font-size: 15px; font-weight: 500; color: var(--error); }
.opts__error.is-visible { display: block; }
.opts.is-error .opt { border-color: rgba(242, 169, 162, 0.7); }

/* ==========================================
   AÇÕES
   ========================================== */

.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.hint { font-size: 13px; color: var(--on-dark-muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 0 30px;
  border-radius: 999px;
  font-size: 17px; font-weight: 600; color: var(--grafite);
  background: var(--grad-btn);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(208, 178, 115, 0.9); }
.btn:focus-visible { outline: 3px solid var(--on-dark); outline-offset: 3px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--ghost { background: transparent; border: 1.5px solid var(--gold); color: var(--gold-2); }
.btn--ghost:hover { background: rgba(208, 178, 115, 0.14); box-shadow: none; }
.btn__dot { display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--grafite); animation: pulse 0.9s ease-in-out infinite; }
.btn--submit.is-sending { opacity: 0.7; cursor: progress; transform: none; box-shadow: none; }
.btn--submit.is-sending .btn__dot { display: block; }
@keyframes pulse { 0%, 100% { transform: scale(0.6); opacity: 0.6; } 50% { transform: scale(1); opacity: 1; } }

.form-feedback { display: none; font-size: 15px; border-radius: 10px; padding: 12px 14px; }
.form-feedback.error { display: block; background: rgba(242, 169, 162, 0.12); color: var(--error); border: 1px solid rgba(242, 169, 162, 0.5); }

/* ---------- rodapé do palco: voltar, assinatura e aviso ---------- */
.bottombar {
  position: relative; z-index: 2; flex: none;
  width: 100%; max-width: var(--col); margin: 0 auto;
  padding: 16px 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
}
/* linha dourada que respira, presa ao topo do rodapé */
.bottombar::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(208, 178, 115, 0.85) 30%, rgba(208, 178, 115, 0.85) 70%, transparent);
  animation: breathe 6s ease-in-out infinite;
}
.bottombar__back {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 44px; padding: 8px 16px 8px 12px;
  border: 1px solid var(--on-dark-line); border-radius: 999px;
  font-size: 14px; color: var(--on-dark);
  transition: border-color 0.15s, background 0.15s;
}
.bottombar__back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bottombar__back:hover { border-color: var(--gold); background: rgba(208, 178, 115, 0.08); }
.bottombar__back:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.bottombar__back[hidden] { display: none; }
.bottombar__info { font-size: 11.5px; line-height: 1.5; color: var(--on-dark); letter-spacing: 0.03em; }
.bottombar__sep { color: var(--gold); margin: 0 2px; }
.bottombar__note { font-size: 10px; line-height: 1.4; color: var(--on-dark-muted); max-width: 62ch; opacity: 0.85; }
.bottombar__link { color: var(--on-dark); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.bottombar__link:hover { color: var(--gold-2); }
.bottombar__link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ==========================================
   ENVIANDO E TELAS FINAIS
   ========================================== */

.breath-line { display: block; width: 56px; height: 2px; background: var(--gold); animation: breathe-line 1.2s ease-in-out infinite; }
@keyframes breathe-line { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
}
.badge > span { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
@supports not (background-clip: text) { .badge > span { color: var(--gold); } }
.badge i { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); display: inline-flex; align-items: center; justify-content: center; }
.badge svg { width: 14px; height: 14px; fill: none; stroke: var(--grafite); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; }
.screen.is-active .badge { animation: scale-in 0.26s ease-out both; }
.screen.is-active .badge svg { animation: draw 0.3s ease-out 0.15s forwards; }
@keyframes scale-in { from { transform: scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
.result .question { max-width: 20ch; }

/* ==========================================
   RESPONSIVO
   ========================================== */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar__wrap { padding: 16px 18px 10px; }
  .topbar__sig { font-size: 21px; }
  .topbar__step { font-size: 12px; letter-spacing: 0.16em; white-space: normal; }
  .screen { padding: 18px 18px 14px; gap: 14px; }
  .sig { font-size: 30px; }
  .headline { font-size: clamp(34px, 9.6vw, 42px); }
  .lead { font-size: 16px; }
  .support, .help, .micro { font-size: 14px; }
  .kicker { font-size: 11px; }
  .kicker__n { font-size: 22px; }
  .question { font-size: clamp(26px, 7.6vw, 34px); }
  .field__input { font-size: 24px; padding: 8px 0 10px; }
  .iti input.field__input { padding-left: 96px; }
  .opts { gap: 6px; }
  .opt { min-height: 46px; padding: 9px 12px; font-size: 15px; gap: 12px; }
  .opt__key { width: 26px; height: 26px; font-size: 12px; }
  .help { font-size: 13px; }
  .field--qual .field__input { font-size: 16px; padding: 8px 0 10px; }
  .actions { margin-top: 2px; }
  .actions .btn { width: 100%; min-height: 54px; }
  .hint { display: none; }
  .bottombar { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px 12px; text-align: right; }
  .bottombar::before { left: 18px; right: 18px; }
  .bottombar__info { font-size: 10.5px; margin-left: auto; }
  .bottombar__tag, .bottombar__note { display: none; }
}

/* janela baixa (notebook com barra do navegador, janela reduzida): tudo mais compacto para o botão caber */
@media (max-height: 720px) and (min-width: 641px) {
  .topbar__wrap { padding: 12px 24px 8px; }
  .topbar__sig { font-size: 22px; }
  .screen { padding: 16px 24px 16px; gap: 14px; }
  .sig { font-size: 30px; }
  .headline { font-size: clamp(32px, 5vw, 52px); }
  .question { font-size: clamp(26px, 3.8vw, 40px); }
  .lead { font-size: 17px; }
  .support, .help { font-size: 15px; margin-top: -4px; }
  .field__input { font-size: clamp(22px, 2.6vw, 28px); padding: 8px 0 10px; }
  .opt { min-height: 46px; padding: 8px 12px; }
  .bottombar { padding-top: 8px; padding-bottom: 10px; }
}

/* ==========================================
   ACESSIBILIDADE
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  .bottombar::before, .breath-line, .btn__dot { animation: none; }
  .screen.is-active, .screen.is-leaving, .screen.is-active .opt, .screen.is-active .badge { animation: none; }
  .screen.is-active .badge svg, .opt--multi:has(input:checked) .opt__check, .opt--multi.is-checked .opt__check { animation: none; stroke-dashoffset: 0; }
  .progress i, .btn, .opt, .field__input { transition: none; }
}
