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

/* ============ TOKENS ============ */
:root {
  --primary: #843b35;
  --primary-dark: #6d3029;
  --secondary: #A08878;
  --bg: #FAF7F5;
  --text: #1A1A1A;
  --white: #FFFFFF;
  --whatsapp: #25D366;
  --muted: #7c7269;
  --line: #e7ddd6;
  --tint: #843b350D;          /* primary 5% */
  --tint-soft: #843b3510;     /* primary ~6% */

  --radius-card: 16px;
  --radius-input: 12px;
  --radius-btn: 50px;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.07);

  --ff-title: 'Poppins', sans-serif;
  --ff-body: 'Inter', sans-serif;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ============ SHELL ============ */
.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}

@media (min-width: 481px) {
  body { padding: 24px 0; background: #efe7e1; }
  .app {
    min-height: calc(100dvh - 48px);
    border-radius: 24px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
  }
}

/* ============ PROGRESS BAR ============ */
.progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--line);
  z-index: 10;
  opacity: 0;
  transition: opacity .3s ease;
}
.progress.is-visible { opacity: 1; }
.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}

/* ============ STEPS ============ */
.step {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
}
.step.is-active {
  display: flex;
  animation: stepIn .3s ease both;
}
.step.is-leaving {
  display: flex;
  animation: stepOut .3s ease both;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes stepOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-28px); }
}

/* footer com botões de navegação */
.step__footer {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.step__footer .btn--primary { flex: 1; }

/* Step do nome: ergue o footer acima do teclado no mobile.
   --kb é a altura do teclado, calculada via VisualViewport no JS. */
.step[data-step="4"] {
  padding-bottom: calc(24px + env(safe-area-inset-bottom) + var(--kb, 0px));
  transition: padding-bottom .2s ease;
}

/* ============ CARD ============ */
.card {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 26px 20px;
}

/* ============ QUESTION HEADERS ============ */
.q-title {
  font-family: var(--ff-title);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -.01em;
  margin-bottom: 6px;
}
.q-sub {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 22px;
}
.q-title + .options { margin-top: 22px; }

/* ============ COVER (STEP 0) ============ */
.step--cover { padding-top: 26px; justify-content: flex-start; }
.cover { display: flex; flex-direction: column; }

.cover__logo {
  width: 100%;
  max-width: 160px;
  margin: 0 auto 18px;
  height: auto;
}

.cover__hero {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.cover__img {
  width: 100%;
  height: 46vh;
  max-height: 360px;
  object-fit: cover;
}
.badge {
  display: inline-block;
  font-family: var(--ff-title);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .01em;
  color: var(--white);
  background: var(--primary);
  padding: 7px 14px;
  border-radius: 50px;
  box-shadow: 0 4px 14px rgba(132, 59, 53, 0.35);
}
.badge--float {
  position: absolute;
  left: 14px;
  bottom: 14px;
}

.cover__title {
  font-family: var(--ff-title);
  font-weight: 700;
  font-size: 1.85rem;
  line-height: 1.18;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}
.cover__title span { color: var(--primary); }

.cover__sub {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 20px;
}

.bullets { list-style: none; margin-bottom: 26px; display: grid; gap: 12px; }
.bullets li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: .98rem;
  font-weight: 500;
}
.bullets__check {
  flex-shrink: 0;
  width: 23px; height: 23px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--tint);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 700;
  margin-top: 1px;
}

.cover__foot {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  margin-top: 14px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--ff-title);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 16px 22px;
  transition: background .2s ease, transform .1s ease, box-shadow .2s ease, opacity .2s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(132, 59, 53, 0.28);
}
.btn--primary:hover { background: var(--primary-dark); }
.btn:active { transform: scale(.98); }

.btn--ghost {
  background: transparent;
  color: var(--muted);
  padding: 16px 8px;
  box-shadow: none;
  font-size: .98rem;
}
.btn--ghost:hover { color: var(--text); }

.btn--whatsapp {
  width: 100%;
  background: var(--whatsapp);
  color: var(--white);
  font-size: 1.1rem;
  padding: 18px 22px;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.35);
}
.btn--whatsapp:hover { background: #1fb558; }
.wa-icon { width: 24px; height: 24px; fill: currentColor; flex-shrink: 0; }

/* ============ OPTION CARDS ============ */
.options { display: grid; gap: 12px; }
.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input);
  padding: 16px 16px;
  transition: border-color .2s ease, background .2s ease, transform .1s ease, box-shadow .2s ease;
}
.opt:active { transform: scale(.985); }
.opt__emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform .25s ease;
}
.opt__label {
  flex: 1;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.25;
}
.opt__label small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: .82rem;
  margin-top: 2px;
}

/* check escondido por padrão */
.opt__check {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  color: transparent;
  font-size: .75rem;
  font-weight: 700;
  transition: all .25s ease;
  transform: scale(.8);
}

/* estado selecionado */
.opt.is-selected {
  border-color: var(--primary);
  border-width: 2px;
  background: var(--tint);
  box-shadow: 0 2px 12px rgba(132, 59, 53, 0.1);
}
.opt.is-selected .opt__emoji { transform: scale(1.12); }
.opt.is-selected .opt__check {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  transform: scale(1);
  animation: pop .3s ease;
}
@keyframes pop {
  0% { transform: scale(.4); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ============ INPUT ============ */
.field { margin-top: 8px; }
.input {
  width: 100%;
  font-family: var(--ff-body);
  font-size: 1.05rem;
  color: var(--text);
  background: var(--white);
  border: 1.5px solid #ddd;
  border-radius: var(--radius-input);
  padding: 16px 16px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input::placeholder { color: #b7aea7; }
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--tint);
}

/* ============ ERROR ============ */
.error {
  color: var(--primary);
  font-size: .88rem;
  font-weight: 500;
  margin-top: 14px;
  min-height: 1.1em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}
.error.is-shown { opacity: 1; transform: translateY(0); }

/* ============ DONE (STEP 5) ============ */
.step--done { justify-content: center; text-align: center; }
.done { display: flex; flex-direction: column; align-items: center; }

.done__check {
  width: 84px; height: 84px;
  margin-bottom: 22px;
}
.done__check svg { width: 100%; height: 100%; }
.done__check circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: drawCircle .5s ease forwards;
}
.done__check path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 44;
  stroke-dashoffset: 44;
  animation: drawCheck .35s .45s ease forwards;
}
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.done__title {
  font-family: var(--ff-title);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: -.01em;
  margin-bottom: 10px;
}
.done__sub {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 24px;
  max-width: 34ch;
}

/* card de resumo */
.summary {
  width: 100%;
  text-align: left;
  background: var(--tint-soft);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-card);
  padding: 18px 18px;
  margin-bottom: 26px;
  display: grid;
  gap: 14px;
}
.summary__row { display: grid; gap: 3px; }
.summary__k {
  font-family: var(--ff-title);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
}
.summary__v { font-size: .98rem; font-weight: 500; line-height: 1.35; }

.done__urgency {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  margin-top: 16px;
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
