/* Calculadora de IMC — identidade "treino & clínica":
   base ink esverdeado, acento menta usado com parcimônia,
   cores semânticas próprias para cada faixa da OMS.
   Design comprometido com o tema escuro (single-theme, cores explícitas). */

:root {
  --ink: #0e1512;
  --surface: #161e1a;
  --surface-2: #1d2621;
  --line: #2b3630;
  --line-soft: #232d28;
  --text: #eef3f0;
  --muted: #93a49b;
  --accent: #4fd6a0;
  --accent-ink: #06231a;

  --c-abaixo: #67b5e6;
  --c-normal: #4fd6a0;
  --c-sobrepeso: #e4a94f;
  --c-obesidade: #e46a60;

  --radius: 16px;
  --shadow: 0 40px 80px -32px rgba(0, 0, 0, 0.7);
  --font-display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

body {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(20px, 6vw, 64px) 20px;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(9, 14, 12, 0.55), rgba(9, 14, 12, 0.78)),
    url("im.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.app {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(24px, 5vw, 36px);
  box-shadow: var(--shadow);
}

/* ---------- header ---------- */

.app__head { display: flex; flex-direction: column; gap: 8px; }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.app__head h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 6vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.sub {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 42ch;
}

/* ---------- form ---------- */

.form {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field { display: flex; flex-direction: column; gap: 7px; }

.field label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.field label span { color: var(--line); font-weight: 600; }

.field input {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.field input::placeholder { color: #55655d; }

.field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 214, 160, 0.22);
}

/* ---------- buttons ---------- */

.btn {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.18s, background 0.18s, color 0.18s, border-color 0.18s;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--primary {
  margin-top: 2px;
  padding: 14px;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  box-shadow: 0 16px 30px -14px rgba(79, 214, 160, 0.55);
}

.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 22px 38px -16px rgba(79, 214, 160, 0.65); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  margin-top: 22px;
  width: 100%;
  padding: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.btn--ghost:hover { color: var(--text); border-color: var(--accent); }

.btn--whats {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 13px;
  text-decoration: none;
  color: #04231a;
  background: #25d366;
  border: none;
  box-shadow: 0 16px 30px -16px rgba(37, 211, 102, 0.55);
}

.btn--whats svg { flex-shrink: 0; }
.btn--whats:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -18px rgba(37, 211, 102, 0.65); }
.btn--whats:active { transform: translateY(0); }

/* ---------- cta (encaminhamento ao profissional) ---------- */

.cta {
  margin-top: 22px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}

.cta__text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.cta__hint {
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- error ---------- */

.error {
  min-height: 1.1em;
  font-size: 0.82rem;
  color: #f0a8a1;
  text-align: center;
}

/* ---------- result ---------- */

.result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.score__num {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3.4rem;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.score__num small {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.score__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid currentColor;
  color: var(--muted);
}

.pill[data-cat="abaixo"]     { color: var(--c-abaixo); background: rgba(103, 181, 230, 0.12); }
.pill[data-cat="normal"]     { color: var(--c-normal); background: rgba(79, 214, 160, 0.12); }
.pill[data-cat="sobrepeso"]  { color: var(--c-sobrepeso); background: rgba(228, 169, 79, 0.12); }
.pill[data-cat="obesidade"]  { color: var(--c-obesidade); background: rgba(228, 106, 96, 0.12); }

.score__range {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  max-width: 22ch;
}

/* ---------- gauge ---------- */

.gauge { margin-top: 22px; position: relative; }

.gauge__track {
  display: flex;
  gap: 3px;
  height: 10px;
}

.gauge__seg {
  border-radius: 3px;
  opacity: 0.32;
  transition: opacity 0.25s;
}

.gauge__seg[data-range="abaixo"]    { background: var(--c-abaixo); }
.gauge__seg[data-range="normal"]    { background: var(--c-normal); }
.gauge__seg[data-range="sobrepeso"] { background: var(--c-sobrepeso); }
.gauge__seg[data-range="obesidade"] { background: var(--c-obesidade); }
.gauge__seg.is-active { opacity: 1; }

.gauge__marker {
  position: absolute;
  top: -6px;
  width: 2px;
  height: 22px;
  background: var(--text);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge__marker::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  background: var(--text);
  border-radius: 50%;
  transform: translateX(-50%);
}

.gauge__ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- reference notes ---------- */

.ref {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.ref h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 14px;
}

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

.note {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--seg, var(--line));
  border-radius: 12px;
  opacity: 0.72;
  transition: opacity 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.note[data-range="abaixo"]    { --seg: var(--c-abaixo); }
.note[data-range="normal"]    { --seg: var(--c-normal); }
.note[data-range="sobrepeso"] { --seg: var(--c-sobrepeso); }
.note[data-range="obesidade"] { --seg: var(--c-obesidade); }

.note.is-active {
  opacity: 1;
  border-color: var(--line);
  border-left-color: var(--seg);
  box-shadow: 0 0 0 1px var(--seg), 0 18px 34px -22px rgba(0, 0, 0, 0.8);
}

.note header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.note h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
}

.note header span {
  font-size: 0.76rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.note__desc {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

.note__rec {
  margin-top: 7px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text);
}

.note__rec strong { color: var(--seg); font-weight: 600; }

.disclaimer {
  margin-top: 16px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
  .score { justify-content: flex-start; }
  .score__meta { align-items: flex-start; text-align: left; }
}
