/* ==========================================================================
   MEU LEVE — Design System
   Mobile-first. Paleta: #40916C / #31572C / #90A955 / #ECF39E / #FAF9F6
   ========================================================================== */

:root {
  --verde-principal: #40916C;
  --verde-escuro: #31572C;
  --verde-oliva: #90A955;
  --verde-claro: #ECF39E;
  --off-white: #FAF9F6;

  --verde-principal-rgb: 64, 145, 108;
  --verde-escuro-rgb: 49, 87, 44;

  --text-body: var(--verde-escuro);
  --text-muted: #5C7A5C;
  --surface: #FFFFFF;
  --surface-soft: #F3F1E9;
  --border-soft: rgba(49, 87, 44, 0.12);
  --shadow-soft: 0 8px 24px rgba(49, 87, 44, 0.10);
  --shadow-card: 0 4px 16px rgba(49, 87, 44, 0.08);

  --font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --vh: 1vh;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--off-white);
  color: var(--text-body);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--verde-escuro);
  margin: 0;
  line-height: 1.18;
}

p { margin: 0; }

button {
  font-family: var(--font-body);
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }

::selection { background: var(--verde-claro); color: var(--verde-escuro); }

/* ---------- Layout shell ---------- */

.app-shell {
  position: relative;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  background: var(--off-white);
  overflow: hidden;
}

@media (min-width: 640px) {
  .app-shell {
    height: 92vh;
    margin: 4vh auto;
    border-radius: 32px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
  }
}

/* ---------- Botanical decorations ---------- */

.leaf-deco {
  position: absolute;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}
.leaf-deco svg { width: 100%; height: 100%; display: block; }

/* ---------- Header ---------- */

.app-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  flex-shrink: 0;
}
.app-header.is-collapsed {
  display: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.brand-mark .brand-logo {
  height: 80px;
  width: auto;
  flex-shrink: 0;
}

.btn-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--verde-escuro);
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-back:active { transform: scale(0.92); }
.btn-back svg { width: 18px; height: 18px; }
.btn-back.is-hidden { visibility: hidden; pointer-events: none; }

.btn-restart {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 6px 4px;
}

/* ---------- Progress bar ---------- */

.progress-wrap {
  position: relative;
  z-index: 5;
  padding: 0 18px 14px;
  flex-shrink: 0;
}
.progress-wrap.is-collapsed {
  display: none;
}

.progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(144, 169, 85, 0.22);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--verde-oliva), var(--verde-principal));
  width: 0%;
  transition: width 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.progress-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Main step area ---------- */

.step-viewport {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 20px 28px;
  animation: stepIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--verde-oliva);
  margin-bottom: 10px;
}

.step-title {
  font-size: 24px;
  margin-bottom: 8px;
}

.step-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 22px;
}

.step-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.step-footer {
  margin-top: 20px;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */

.btn-primary {
  width: 100%;
  padding: 17px 20px;
  border-radius: var(--radius-pill);
  background: var(--verde-principal);
  color: var(--off-white);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 10px 24px rgba(var(--verde-principal-rgb), 0.32);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.4;
  box-shadow: none;
  pointer-events: none;
}
.btn-primary svg { width: 18px; height: 18px; }

.btn-secondary {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--verde-escuro);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  margin-top: 10px;
}

/* ---------- Option cards (single/multi choice) ---------- */

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  text-align: left;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-body);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  min-height: 56px;
}
.option-card:active { transform: scale(0.985); }

.option-card .option-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--verde-principal);
}
.option-card .option-icon svg { width: 100%; height: 100%; }

.option-card .option-text { flex: 1; }

.option-card .option-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-soft);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.option-card.is-multi .option-check { border-radius: 6px; }
.option-card .option-check svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s ease;
  color: var(--off-white);
}

.option-card.is-selected {
  border-color: var(--verde-principal);
  background: rgba(var(--verde-principal-rgb), 0.06);
}
.option-card.is-selected .option-check {
  background: var(--verde-principal);
  border-color: var(--verde-principal);
}
.option-card.is-selected .option-check svg {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Slider (drag) ---------- */

.slider-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px 20px;
}

.slider-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 34px;
}

.slider-value .value-number {
  font-family: var(--font-heading);
  font-size: 64px;
  font-weight: 600;
  color: var(--verde-principal);
  font-variant-numeric: tabular-nums;
}

.slider-value .value-unit {
  font-size: 20px;
  font-weight: 600;
  color: var(--verde-oliva);
}

.range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  border-radius: var(--radius-pill);
  background: rgba(144, 169, 85, 0.22);
  outline: none;
  touch-action: pan-y;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--verde-principal);
  border: 4px solid var(--off-white);
  box-shadow: 0 4px 14px rgba(var(--verde-principal-rgb), 0.45);
  cursor: grab;
  margin-top: -10px;
}
.range-input::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.08); }

.range-input::-moz-range-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--verde-principal);
  border: 4px solid var(--off-white);
  box-shadow: 0 4px 14px rgba(var(--verde-principal-rgb), 0.45);
  cursor: grab;
}

.range-input::-webkit-slider-runnable-track { height: 14px; border-radius: var(--radius-pill); }
.range-input::-moz-range-track { height: 14px; border-radius: var(--radius-pill); background: transparent; }
.range-input::-moz-range-progress { height: 14px; border-radius: var(--radius-pill); background: var(--verde-principal); }

.slider-scale {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.slider-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 26px;
  font-size: 12.5px;
  color: var(--verde-oliva);
  font-weight: 600;
}
.slider-hint svg { width: 16px; height: 16px; animation: swipeHint 1.6s ease-in-out infinite; }

@keyframes swipeHint {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

/* ---------- Text input step ---------- */

.text-input-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.text-input {
  width: 100%;
  padding: 18px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-soft);
  background: var(--surface);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-body);
  font-family: var(--font-body);
}
.text-input:focus { outline: none; border-color: var(--verde-principal); }
.text-input::placeholder { color: #A9B8A9; font-weight: 500; }

/* ---------- Intro screen ---------- */

.intro-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 26px 18px;
  position: relative;
}

.intro-image {
  align-self: stretch;
  width: auto;
  flex-shrink: 0;
  margin: 0 -26px 18px;
  overflow: hidden;
  position: relative;
}
.intro-image img { width: 100%; height: 100%; display: block; }

.intro-image::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80px;
  pointer-events: none;
  background: linear-gradient(0deg, var(--off-white), rgba(250, 249, 246, 0));
}

.intro-title {
  font-size: clamp(24px, 6.5vw, 30px);
  margin-bottom: 10px;
}
.intro-title em { color: var(--verde-principal); font-style: normal; }

.intro-subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
  max-width: 380px;
}

.intro-stats {
  display: flex;
  gap: 18px;
  margin-bottom: 20px;
}
.intro-stats .stat { text-align: center; }
.intro-stats .stat-number {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--verde-principal);
  font-weight: 600;
}
.intro-stats .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  max-width: 90px;
}

.intro-step .step-footer {
  width: 100%;
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 12px;
}

/* Telas altas e estreitas / com pouca altura de viewport (ex.: celulares
   full HD 1080x1920): a imagem passa a ser dimensionada pela ALTURA
   (~48% da tela) em vez da largura, mantendo a proporção original
   (sem cortar nada) e deixando espaço para o texto e o botão. */
@media (max-height: 700px) {
  .intro-image {
    align-self: center;
    width: auto;
    max-width: 100%;
    margin: 0 auto 12px;
  }
  .intro-image img {
    width: auto;
    height: 48vh;
    height: calc(var(--vh, 1vh) * 48);
    max-width: 100%;
    max-height: 48vh;
    max-height: calc(var(--vh, 1vh) * 48);
    object-fit: contain;
    margin: 0 auto;
  }
  .intro-title { font-size: clamp(21px, 6vw, 25px); margin-bottom: 6px; }
  .intro-subtitle { margin-bottom: 12px; }
  .intro-stats { margin-bottom: 12px; }
}

/* ---------- Loading screen ---------- */

.loading-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 32px;
}

.loading-ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  position: relative;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-ring svg.spinner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: spin 1.4s linear infinite;
}
.loading-ring .ring-pct {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: var(--verde-escuro);
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-message {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--verde-escuro);
  min-height: 44px;
  transition: opacity 0.3s ease;
}

.loading-track {
  width: 100%;
  max-width: 260px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(144, 169, 85, 0.22);
  margin-top: 22px;
  overflow: hidden;
}
.loading-track .loading-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--verde-oliva), var(--verde-principal));
  transition: width 0.2s linear;
}

/* ---------- Result screen ---------- */

.result-step { padding: 8px 20px 150px; }

.result-hero {
  text-align: center;
  padding: 6px 6px 22px;
}
.result-hero .result-eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--verde-oliva);
  margin-bottom: 8px;
}
.result-hero h1 { font-size: 26px; margin-bottom: 8px; }
.result-hero p { color: var(--text-muted); font-size: 14.5px; line-height: 1.5; }

.imc-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
  border: 1px solid var(--border-soft);
}
.imc-card .imc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.imc-card .imc-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.imc-card .imc-value { font-family: var(--font-heading); font-size: 30px; color: var(--verde-principal); font-weight: 600; }
.imc-card .imc-tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--verde-claro);
  color: var(--verde-escuro);
  font-size: 12px;
  font-weight: 700;
}
.imc-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #ECF39E, #90A955 35%, #40916C 60%, #31572C 100%);
  position: relative;
  margin-top: 6px;
}
.imc-bar .imc-dot {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--verde-escuro);
  transform: translate(-50%, -50%);
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.plan-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
}
.plan-item .plan-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--verde-claro);
  color: var(--verde-escuro);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-item .plan-icon svg { width: 16px; height: 16px; }
.plan-item .plan-text { font-size: 14px; line-height: 1.45; color: var(--text-body); }
.plan-item .plan-text strong { color: var(--verde-escuro); }

.section-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--verde-oliva);
  margin: 6px 0 12px;
}

.testimonial-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 10px;
}

.testimonial-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
}
.testimonial-media {
  background: var(--surface-soft);
  overflow: hidden;
}
.testimonial-media img {
  width: 100%;
  height: auto;
  display: block;
}
.testimonial-media.is-placeholder {
  aspect-ratio: 3 / 4;
}
.testimonial-card .testimonial-caption {
  padding: 14px 16px 16px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.testimonial-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--border-soft);
  color: var(--verde-oliva);
}
.testimonial-placeholder svg { width: 26px; height: 26px; }
.testimonial-placeholder span {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.testimonial-placeholder code {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(144, 169, 85, 0.14);
  padding: 3px 9px;
  border-radius: 6px;
}
.testimonial-disclaimer {
  font-size: 11px;
  color: #A9B8A9;
  text-align: center;
  margin: 8px 0 24px;
  line-height: 1.5;
}

.result-cta {
  padding-top: 6px;
}

/* ---------- Floating CTA bar (aparece imediatamente na tela de resultado) ---------- */

.floating-cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 18px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(250, 249, 246, 0) 0%, var(--off-white) 42%, var(--off-white) 100%);
  transition: opacity 0.25s ease;
}
.floating-cta .btn-primary {
  box-shadow: 0 -2px 0 rgba(255, 255, 255, 0.4) inset, 0 12px 28px rgba(var(--verde-escuro-rgb), 0.28);
}

/* ---------- Utility ---------- */

.fade-hidden { opacity: 0; pointer-events: none; }

@media (min-width: 640px) {
  .step-title { font-size: 27px; }
  .intro-title { font-size: 34px; }
}
