/* =========================================================
   best. — Calculadora de ROI de tráfego pago
   Identidade best. (Ink · Paper · Lime · Signal / Archivo Black
   + Space Grotesk + JetBrains Mono) em uma leitura
   contemporânea: cantos suaves, profundidade discreta, respiro.
   Lime e Signal só em massa sólida — nunca degradê, nunca alpha.
   ========================================================= */

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

:root {
  /* paleta */
  --ink:        #0A0A0A;
  --paper:      #F4F1EA;
  --lime:       #E8FF3A;
  --signal:     #FF3B1F;

  --surface:    #FFFFFF;
  --surface-2:  #FAF8F1;              /* painéis internos (faixa de derivados, chips) */
  --on-dark:      #F4F1EA;
  --on-dark-mut:  #9C978C;
  --on-dark-cap:  #C9C4B8;
  --muted:      #5F5850;              /* texto secundário sobre claro — AA */
  --line:       rgba(10, 10, 10, 0.09);
  --line-soft:  rgba(10, 10, 10, 0.06);
  --hair-dark:  rgba(244, 241, 234, 0.14);

  /* sombras (neutras, nunca sobre cor de marca) */
  --shadow-sm: 0 1px 2px rgba(10,10,10,0.04), 0 1px 3px rgba(10,10,10,0.03);
  --shadow-md: 0 2px 6px rgba(10,10,10,0.04), 0 14px 32px -12px rgba(10,10,10,0.12);
  --shadow-lg: 0 10px 24px -8px rgba(10,10,10,0.16), 0 36px 64px -24px rgba(10,10,10,0.38);

  /* raios */
  --r-lg: 22px;
  --r:    16px;
  --r-sm: 11px;
  --r-pill: 999px;

  /* tipografia */
  --font-display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --font-text:    "Space Grotesk", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --maxw: 1200px;
  --gap: 24px;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--lime); color: var(--ink); }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 48px);
}

.num { font-variant-numeric: tabular-nums; }

/* ponto signal — assinatura da marca */
.dot {
  display: inline-block;
  width: 0.26em;
  height: 0.26em;
  border-radius: 2px;
  background: var(--signal);
  margin-left: 0.06em;
  vertical-align: baseline;
}
.hero__title-hl .dot { margin-left: 0.12em; }

/* ---------- chrome técnico ---------- */
.chrome {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(18px, 5vw, 48px);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.chrome span:last-child { text-align: right; }
@media (max-width: 620px) { .chrome span:last-child { display: none; } }

/* ---------- hero ---------- */
.hero {
  background: var(--ink);
  color: var(--on-dark);
}
.hero__inner { padding-block: clamp(44px, 7vw, 92px); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  font-family: var(--font-mono);
  font-size: clamp(10.5px, 2.6vw, 12px);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lime);
}
.eyebrow__bar { width: 28px; height: 3px; border-radius: 999px; background: var(--signal); }

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 6.4vw, 4.1rem);
  line-height: 1.0;
  letter-spacing: -0.025em;
  text-transform: lowercase;
}
.hero__title-hl { display: block; color: var(--lime); }

.hero__sub {
  margin-top: 24px;
  max-width: 54ch;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--on-dark-cap);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  padding: 11px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark);
  background: transparent;
  border: 1px solid rgba(244, 241, 234, 0.28);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-ghost:hover { background: var(--lime); color: var(--ink); border-color: var(--lime); }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 43fr) minmax(0, 57fr);
  gap: var(--gap);
  align-items: start;
  padding-block: clamp(28px, 5vw, 56px);
}
.col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  :root { --gap: 18px; }
}

/* ---------- card base ---------- */
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  padding: clamp(22px, 3vw, 32px);
}

/* ---------- step ---------- */
.step__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.badge {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}
.step__head h2,
.chain-card__head h2,
.reading h2 {
  font-family: var(--font-text);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-transform: lowercase;
}
.tag {
  margin-left: auto;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- fields ---------- */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }

.field > label {
  display: block;
  margin-bottom: 9px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.hint { font-weight: 400; font-size: 0.88em; color: var(--muted); }

.control { position: relative; display: flex; align-items: center; }
.control::before {
  content: attr(data-affix);
  position: absolute;
  left: 15px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
}
.control--suffix::before { left: auto; right: 16px; }

.control input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 13px 15px 13px 40px;
  font: 600 1.05rem/1.2 var(--font-text);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.control--suffix input { padding: 13px 38px 13px 15px; }
.control input::placeholder { color: #B4AEA1; font-weight: 400; }

.control input:focus-visible,
.slider input[type="range"]:focus-visible,
.btn-ghost:focus-visible,
#loadExample:focus-visible {
  outline: none;
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--lime);
}
.btn-ghost:focus-visible { box-shadow: 0 0 0 3px var(--lime); border-color: var(--lime); }

/* ---------- slider ---------- */
.slider { display: flex; align-items: center; gap: 18px; }

.slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 24px;
  background: transparent;
  cursor: pointer;
  border-radius: var(--r-pill);
}
.slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: linear-gradient(to right,
    var(--lime) 0 var(--p, 33%),
    #E7E2D6 var(--p, 33%) 100%);   /* stops rígidos = bloco sólido, ponta arredondada */
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  box-shadow: 0 2px 6px rgba(10, 10, 10, 0.22);
}
.slider input[type="range"]::-moz-range-track {
  height: 6px; border-radius: var(--r-pill); background: #E7E2D6;
}
.slider input[type="range"]::-moz-range-progress {
  height: 6px; border-radius: var(--r-pill); background: var(--lime);
}
.slider input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--ink);
  box-shadow: 0 2px 6px rgba(10, 10, 10, 0.22);
}
.slider output {
  min-width: 3.6ch;
  text-align: right;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.micro { margin-top: 12px; font-size: 0.9rem; color: var(--muted); }
.micro strong { color: var(--ink); font-weight: 700; }

/* ---------- faixa de derivados ---------- */
.derived {
  margin-top: 22px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 4px 16px;
}
.derived__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
}
.derived__row + .derived__row { border-top: 1px solid var(--line-soft); }
.derived__row > span:first-child {
  font-size: 0.86rem;
  color: var(--muted);
}
.derived__val {
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.derived__val.is-lime {
  background: var(--lime);
  color: var(--ink);
  padding: 2px 10px;
  border-radius: 7px;
}

/* ---------- card escuro de destaque ---------- */
.result-hero {
  position: relative;
  padding: clamp(26px, 3.4vw, 40px);
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.result-hero::after {
  content: "";
  position: absolute;
  top: 20px;
  right: 20px;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--signal);
}
.result-hero__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--on-dark-mut);
}
.result-hero__value {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.7rem, 9vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--lime);
  overflow-wrap: anywhere;
}
.result-hero__cap {
  margin-top: 14px;
  max-width: 36ch;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--on-dark-cap);
}
.result-hero__aside {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: rgba(244, 241, 234, 0.07);
}
.result-hero__aside-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-mut);
}
.result-hero__aside-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.result-hero__rule {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--hair-dark);
}
.result-hero__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.result-hero__foot-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-dark-mut);
}
.result-hero__foot-value {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.6vw, 2.5rem);
  line-height: 1;
  color: #fff;
  overflow-wrap: anywhere;
}
.result-hero__daily {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: rgba(244, 241, 234, 0.07);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--on-dark);
  text-align: right;
}
.result-hero__daily small {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-mut);
}

/* ---------- grade 2×2 ---------- */
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
@media (max-width: 540px) { .grid2 { grid-template-columns: 1fr; } }

.metric {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.metric__bar {
  display: block;
  width: 26px;
  height: 4px;
  border-radius: var(--r-pill);
  margin-bottom: 14px;
}
.metric--signal .metric__bar { background: var(--signal); }
.metric--ink    .metric__bar { background: var(--ink); }
.metric--lime   .metric__bar { background: var(--lime); }

.metric__label {
  font-size: 0.84rem;
  color: var(--muted);
}
.metric__value {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.6vw, 1.95rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.metric__sub {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.metric__sub.is-pos { background: var(--lime); color: var(--ink); }
.metric__sub.is-neg { background: var(--signal); color: var(--paper); }
.metric__sub.is-dash { padding: 0; background: none; }

/* ---------- leitura rápida ---------- */
.reading__text { margin-top: 12px; font-size: 1rem; line-height: 1.65; color: #33302B; }
.reading__text strong {
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 -0.5em 0 var(--lime);
}
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.chip {
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- cadeia de cálculo (largura total, abaixo das colunas) ---------- */
.chain-card { grid-column: 1 / -1; }
.chain-card__head { margin-bottom: 26px; max-width: 760px; }
.chain-card__head p { margin-top: 8px; font-size: 0.92rem; color: var(--muted); }

.chain { list-style: none; max-width: 780px; }
.chain__step {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 22px;
}
.chain__step:last-child { padding-bottom: 0; }
.chain__step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 18px;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--line);
}
.chain__dot {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  flex: none;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px var(--surface);
}
.chain__step--final .chain__dot {
  background: var(--lime);
  box-shadow: 0 0 0 4px var(--surface), inset 0 0 0 1.5px rgba(10, 10, 10, 0.28);
}
.chain__name { font-weight: 700; font-size: 0.97rem; }
.chain__step--final .chain__name {
  box-shadow: inset 0 -0.5em 0 var(--lime);
}
.chain__calc {
  margin-top: 7px;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #4a463f;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ---------- aviso de estimativa (abaixo do resumo do plano) ---------- */
.notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: calc(clamp(22px, 3vw, 32px) + 6px);
  box-shadow: var(--shadow-md), inset 4px 0 0 var(--signal);
}
.notice__tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.notice__tag .dot { width: 7px; height: 7px; margin: 0; border-radius: 2px; }
.notice__text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #33302B;
}
.notice__text strong { color: var(--ink); font-weight: 700; }

/* ---------- rodapé (faixa escura + CTA) ---------- */
.foot {
  margin-top: clamp(32px, 6vw, 64px);
  background: var(--ink);
  color: var(--on-dark);
}
.foot .wrap { padding-block: clamp(44px, 7vw, 84px); }

.foot__kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lime);
}
.foot__kicker .dot { width: 7px; height: 7px; margin: 0; border-radius: 2px; }

.foot__cta-title {
  max-width: 18ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.6vw, 2.7rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}
.foot__cta-text {
  margin-top: 16px;
  max-width: 48ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--on-dark-cap);
}
.foot__cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lime);
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: transform 0.12s ease, background 0.12s ease;
}
.foot__cta-btn:hover { transform: translateY(-2px); background: #fff; }
.foot__cta-btn:focus-visible {
  outline: 2px solid var(--on-dark);
  outline-offset: 3px;
}

.foot__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  margin-top: clamp(40px, 6vw, 60px);
  padding-top: 28px;
  border-top: 1px solid var(--hair-dark);
}
.foot__by {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  font-size: 0.9rem;
  color: var(--on-dark-mut);
}
.foot__logo {
  font-family: var(--font-display);
  font-size: 1.15em;             /* proporcional ao texto ao redor */
  text-transform: lowercase;
  color: var(--on-dark);
}
.foot__by .foot__logo .dot { width: 0.24em; height: 0.24em; }
.foot__tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--on-dark-mut);
}

/* ---------- estado vazio ---------- */
.derived__val.is-dash,
.metric__value.is-dash,
.result-hero__value.is-dash,
.result-hero__foot-value.is-dash,
.result-hero__aside-value.is-dash {
  font-family: var(--font-text);
  font-weight: 600;
  letter-spacing: 0;
}
.derived__val.is-dash,
.metric__value.is-dash { font-size: 1.3rem; color: #B4AEA1; }
.result-hero__value.is-dash { font-size: 2rem; color: var(--on-dark-mut); }
.result-hero__foot-value.is-dash { font-size: 1.3rem; color: var(--on-dark-mut); }
.result-hero__aside-value.is-dash { font-size: 1rem; color: var(--on-dark-mut); }
#r-daily.is-dash { color: var(--on-dark-mut); }

/* ---------- mobile ---------- */
@media (max-width: 540px) {
  body { font-size: 16px; }
  .result-hero__foot { align-items: flex-start; }
  .result-hero__daily { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
