/* Design system da Saúde Transparente — os mesmos tokens do dashboard
   (documentation/DESIGN_SYSTEM.md, dashboard/src/styles.css). Uma superfície
   escura por tela: aqui ela é o resultado, o equivalente ao KPI principal. */
:root {
  color-scheme: light;
  --forest-950: #06130e;
  --forest-900: #0a1c15;
  --forest-800: #123426;
  --forest-700: #1a5638;
  --brand: #3ba246;
  --brand-bright: #67c94c;
  --signal: #82dd5b;
  --mint: #dff1dc;
  --mint-soft: #edf6eb;
  --canvas: #f3f5f1;
  --surface: rgba(255, 255, 255, 0.94);
  --card: #ffffff;
  --ink: #101712;
  --ink-2: #4f5c53;
  --ink-3: #849087;
  --border: rgba(10, 28, 21, 0.09);
  --border-strong: rgba(10, 28, 21, 0.14);
  --bad: #c3463b;
  --amber: #dfa32f;
  --warn-bg: #fff8e8;
  --warn-bd: #ecd595;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--canvas); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  position: relative;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 86% 7%, rgba(104, 192, 78, 0.09), transparent 26rem),
    linear-gradient(180deg, #f7f8f5 0, var(--canvas) 32rem);
  color: var(--ink);
  font: 15px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
:focus-visible { outline: 3px solid rgba(59, 162, 70, 0.28); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Os círculos moram num contêiner que corta: soltos no body, o da direita
   alargava a página em 200 px e abria rolagem lateral. */
.fundo { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.ambient { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(2px); z-index: 0; }
.ambient-one { width: 420px; height: 420px; right: -230px; top: 280px; background: rgba(113, 195, 85, 0.06); }
.ambient-two { width: 280px; height: 280px; left: -180px; top: 820px; background: rgba(49, 126, 80, 0.04); }

/* ── Cabeçalho ──────────────────────────────────────────────────────────── */
.topo {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247, 248, 245, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.topo-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 12px 24px; }
.logo img { display: block; width: 172px; height: auto; }
.selo { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; color: var(--forest-700); background: var(--mint-soft); border: 1px solid rgba(59, 162, 70, 0.16); border-radius: 999px; font-size: 12px; font-weight: 650; }
.ponto { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-bright); box-shadow: 0 0 0 0 rgba(103, 201, 76, 0.5); animation: pulso 2.4s ease-out infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(103, 201, 76, 0.45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(103, 201, 76, 0); } }

/* ── Página ─────────────────────────────────────────────────────────────── */
.pagina {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  grid-template-areas: "abertura calc" "como calc";
  align-items: start;
  gap: 24px 54px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 24px 62px;
}
.abertura { grid-area: abertura; padding-top: 14px; animation: entra .42s ease both; }
.card.calc { grid-area: calc; position: sticky; top: 92px; scroll-margin-top: 84px; } /* .card.calc: o .card depois põe relative */
.como { grid-area: como; }

.kicker { display: flex; align-items: center; gap: 9px; color: var(--forest-700); font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.kicker::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--brand); }
h1 { margin: 14px 0 18px; font-size: clamp(34px, 4.4vw, 54px); font-weight: 680; line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
h1 em { font-style: normal; color: var(--forest-700); }
.lede { max-width: 540px; color: var(--ink-2); font-size: 17px; line-height: 1.6; }

.provas { display: grid; gap: 14px; margin-top: 32px; list-style: none; max-width: 520px; }
.provas li { display: flex; align-items: flex-start; gap: 14px; }
.provas .ic { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 6px 16px rgba(13, 35, 23, 0.05); color: var(--forest-700); }
.provas svg, .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.provas div { display: flex; flex-direction: column; }
.provas b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.provas span { color: var(--ink-2); font-size: 14px; }

/* ── Cartão ─────────────────────────────────────────────────────────────── */
.card { position: relative; padding: 26px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 12px 34px rgba(13, 35, 23, 0.06), inset 0 1px rgba(255, 255, 255, 0.85); }
.card h2 { font-size: 19px; font-weight: 720; letter-spacing: -.018em; }
.card .sub { margin-top: 3px; color: var(--ink-3); font-size: 14px; }
.etapa { animation: entra .42s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.passos { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.passos span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--mint-soft); color: var(--ink-3); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.passos span.on { background: var(--forest-800); color: #fff; }
.passos span.ok { background: var(--brand); color: #fff; }
.passos i { flex: 1; height: 2px; border-radius: 2px; background: var(--mint); max-width: 54px; }
.passos i.on { background: var(--brand); }

/* ── Campos ─────────────────────────────────────────────────────────────── */
.campo { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; border: 0; min-width: 0; }
.rot { color: var(--ink); font-size: 13.5px; font-weight: 650; padding: 0; }
.dica { color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }
.erro { display: none; color: var(--bad); font-size: 12.5px; font-weight: 600; }
.campo.invalido .erro { display: block; }
.campo.invalido .dica { display: none; }

input, select {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  font-size: 16px; /* 16px: abaixo disso o iOS dá zoom no foco */
  transition: border-color .18s ease, box-shadow .18s ease;
  appearance: none;
  -webkit-appearance: none;
}
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%234f5c53' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}
select:invalid { color: var(--ink-3); }
input:hover, select:hover { border-color: rgba(26, 86, 56, 0.35); }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59, 162, 70, 0.18); }
.campo.invalido input, .campo.invalido select, .campo.invalido .moeda { border-color: var(--bad); }

.moeda { display: flex; align-items: center; background: var(--card); border: 1px solid var(--border-strong); border-radius: 13px; transition: border-color .18s ease, box-shadow .18s ease; }
.moeda:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59, 162, 70, 0.18); }
.moeda > span { padding-left: 14px; color: var(--ink-3); font-weight: 650; }
.moeda input { border: 0; box-shadow: none !important; padding-left: 8px; font-variant-numeric: tabular-nums; }

.dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.dupla .campo { margin-top: 18px; }
.dupla.curta { gap: 10px; }

.opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opcao { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 11px 13px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 13px; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.opcao input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.opcao b { font-size: 14px; font-weight: 680; }
.opcao span { color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.opcao:hover { border-color: rgba(26, 86, 56, 0.35); }
.opcao:has(input:checked) { background: var(--mint-soft); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.opcao:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(59, 162, 70, 0.22); }
.campo.invalido .opcao { border-color: rgba(195, 70, 59, 0.5); }

.pote { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Botões ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: 52px; margin-top: 24px; padding: 13px 20px;
  color: #fff; background: var(--forest-800);
  border: 0; border-radius: 14px;
  font-size: 16px; font-weight: 680; letter-spacing: -.005em;
  box-shadow: 0 10px 24px rgba(18, 52, 38, 0.2), inset 0 1px rgba(255, 255, 255, 0.1);
  transition: background .18s ease, transform .18s ease;
}
.btn:hover { background: var(--forest-700); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn .gira { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.btn-sec { min-height: 52px; margin-top: 24px; padding: 13px 18px; color: var(--forest-700); background: var(--mint-soft); border: 0; border-radius: 14px; font-weight: 650; transition: background .18s ease; }
.btn-sec:hover { background: var(--mint); }
.acoes { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.aceite { margin-top: 18px; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }

/* ── Resultado: a superfície escura ─────────────────────────────────────── */
.calc.escuro {
  overflow: hidden;
  color: #f4f8f4;
  background:
    radial-gradient(circle at 12% 0%, rgba(78, 169, 93, 0.25), transparent 34%),
    radial-gradient(circle at 92% 115%, rgba(69, 151, 105, 0.2), transparent 42%),
    linear-gradient(135deg, #0d261b 0%, #071610 54%, #07120e 100%);
  border: 1px solid rgba(163, 214, 166, 0.13);
  box-shadow: 0 26px 70px rgba(5, 25, 15, 0.18), inset 0 1px rgba(255, 255, 255, 0.08);
}
.calc.escuro::before { content: ""; position: absolute; inset: 0; opacity: .25; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px); background-size: 54px 54px; mask-image: linear-gradient(to left, #000, transparent 75%); -webkit-mask-image: linear-gradient(to left, #000, transparent 75%); }
#resultado { position: relative; outline: none; }
.res-kicker { display: flex; align-items: center; gap: 9px; color: rgba(213, 226, 216, 0.62); font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.res-kicker .ic { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 7px; background: rgba(117, 216, 86, .11); border: 1px solid rgba(117, 216, 86, .16); }
.res-kicker .ic span { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px rgba(130, 221, 91, .82); }
.res-num { margin: 12px 0 6px; font-size: clamp(40px, 6.4vw, 58px); font-weight: 570; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-num small { color: rgba(213, 226, 216, 0.55); font-size: .42em; font-weight: 520; letter-spacing: -.01em; margin-right: 4px; }
.res-sub { color: rgba(226, 237, 228, 0.72); font-size: 14.5px; }
.res-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 24px; overflow: hidden; background: rgba(230, 243, 232, 0.1); border: 1px solid rgba(230, 243, 232, 0.1); border-radius: 16px; }
.res-stats div { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; background: rgba(7, 22, 16, 0.72); }
.res-stats span { color: rgba(213, 226, 216, 0.55); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.res-stats b { font-size: 20px; font-weight: 620; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.res-stats b.verde { color: var(--signal); }
.res-anos { margin-top: 20px; }
.res-anos h3 { color: rgba(213, 226, 216, 0.62); font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.res-anos table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.res-anos th, .res-anos td { padding: 7px 0; text-align: right; border-bottom: 1px solid rgba(230, 243, 232, 0.08); }
.res-anos th { color: rgba(213, 226, 216, 0.48); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.res-anos th:first-child, .res-anos td:first-child { text-align: left; }
.res-anos td { color: rgba(244, 248, 244, 0.9); }
.res-anos td.alto { color: #f0bd58; }
.res-proximo { display: flex; gap: 12px; margin-top: 22px; padding: 14px 16px; background: rgba(117, 216, 86, 0.08); border: 1px solid rgba(117, 216, 86, 0.16); border-radius: 14px; font-size: 14px; color: rgba(236, 245, 237, 0.9); }
.res-proximo svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; fill: none; stroke: var(--signal); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.res-aviso { margin-top: 12px; padding: 12px 14px; color: #f6dca4; background: rgba(240, 189, 88, 0.08); border: 1px solid rgba(240, 189, 88, 0.2); border-radius: 12px; font-size: 13px; }
.res-nota { margin-top: 16px; color: rgba(213, 226, 216, 0.5); font-size: 12px; line-height: 1.5; }
.res-refazer { margin-top: 16px; padding: 8px 0; color: rgba(236, 245, 237, 0.8); background: none; border: 0; font-size: 14px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(236, 245, 237, 0.3); }
.res-refazer:hover { color: #fff; }

/* ── Como calculamos ────────────────────────────────────────────────────── */
.como ol { display: grid; gap: 14px; margin-top: 16px; padding: 0; list-style: none; counter-reset: passo; }
.como li { position: relative; padding-left: 40px; color: var(--ink-2); font-size: 14.5px; counter-increment: passo; }
.como li::before { content: counter(passo); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--mint-soft); color: var(--forest-700); font-size: 12.5px; font-weight: 750; }
.como li b { color: var(--ink); font-weight: 680; }
.como .nota { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--ink-3); font-size: 12.5px; }

/* ── Rodapé ─────────────────────────────────────────────────────────────── */
.rodape { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 24px 24px 36px; border-top: 1px solid var(--border); color: var(--ink-3); font-size: 12.5px; }
.rodape img { width: 120px; height: auto; opacity: .85; }

/* ── Responsivo ─────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .pagina { grid-template-columns: minmax(0, 1fr); grid-template-areas: "abertura" "calc" "como"; gap: 24px; padding: 32px 16px 42px; }
  .card.calc { position: static; }
  .abertura { padding-top: 0; }
  .provas { margin-top: 24px; }
}
@media (max-width: 620px) {
  .topo-in { padding: 10px 16px; }
  .logo img { width: 136px; }
  .selo { display: none; }
  .pagina { padding: 22px 12px 36px; gap: 18px; }
  .abertura { padding: 0 4px; }
  h1 { margin: 10px 0 12px; }
  .lede { font-size: 15.5px; }
  .provas { display: none; }
  .card { padding: 20px 18px; border-radius: 20px; }
  .dupla:not(.curta) { grid-template-columns: 1fr; }
  .opcoes { grid-template-columns: 1fr 1fr; }
  .res-stats b { font-size: 17px; }
  .rodape { flex-direction: column; align-items: flex-start; padding: 22px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
