/* Calculadora Residual — estilos da tela
   ─────────────────────────────────────────────────────────────────────────────
   Carregado depois de ../tema.css e ../campo.css. Antes esta pagina tinha a
   TERCEIRA linguagem visual do RatApp: verde neon #0AE64C, fundo #f7f8fa, pesos
   800, 39 cores distintas. Agora usa os mesmos tokens do CRM. Ver ../../DESIGN.md.

   O que NAO foi normalizado, de proposito: as 5 cores dos centros de carga no
   desenho do garfo. Sao codificacao de dado (5 marcadores que precisam ser
   distinguiveis entre si), nao cromo de marca — mesma logica dos 4 badges ISO.
   Elas foram escurecidas para o ramo -700, que passa em AA sobre branco; antes
   eram tons claros (#f59e0b da 2,1:1) usados inclusive como cor de texto de 8px. */

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 48px;
}

.wrap { width: 100%; max-width: 34rem; }

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 4px;
}

.subtitle {
  font-size: 15px;
  color: var(--ink-3);
  margin-bottom: 24px;
}

/* ── PASSOS ──────────────────────────────────────────────────────────────── */

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px;
  margin-bottom: 12px;
  transition: opacity var(--dur) var(--ease);
}
.step.locked { opacity: .4; pointer-events: none; }

.step-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.step-num {
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--ink);          /* grafite sobre ambar, como o botao "brand" do CRM */
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-title { font-size: 15px; font-weight: 700; color: var(--ink); }

.field { margin-bottom: 12px; }
.field .campo { width: 100%; }

select.campo {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%231b1a19' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select.campo:disabled { opacity: .5; cursor: default; }

/* ── BADGES DE CLASSE ISO ────────────────────────────────────────────────── */
/* Quatro categorias que precisam ser distinguiveis entre si; por isso mantem 4
   matizes em vez de virarem todas .pill-neutro. Os tons sao os -700/-800 do
   mesmo ramo que o CRM usa, entao passam em AA. */

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  margin-left: 8px;
}
.badge-iso2  { background: var(--info-bg); color: var(--info-ink); }
.badge-iso3  { background: var(--brand-20); color: var(--brand-ink); }
.badge-iso4  { background: #fce7f3; color: #9d174d; }
.badge-pinox { background: #ede9fe; color: #6b21a8; }

/* ── RESULTADO ───────────────────────────────────────────────────────────── */

#resultado {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px;
  margin-top: 4px;
}

.res-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 2px;
}

.res-sub { font-size: 14px; color: var(--ink-3); margin-bottom: 20px; }

table { width: 100%; border-collapse: collapse; }

thead th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-3);
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line-forte);
  text-align: right;
}
thead th:first-child { text-align: left; }

tbody tr { border-bottom: 1px solid var(--line-soft); }
tbody td { padding: 11px 0; font-size: 15px; text-align: right; vertical-align: middle; }
tbody td:first-child { text-align: left; color: var(--ink-2); font-size: 14px; }

.val-cre  { font-weight: 700; font-size: 17px; color: var(--ok-ink); }
.val-ceq  { color: var(--ink-3); font-size: 14px; }

/* Limitante = o garfo, e nao a empilhadeira, e quem trava a capacidade */
.limitante {
  color: var(--bad-ink);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  display: block;
}

.ponta { font-size: 11px; font-weight: 600; color: var(--ink-3); }

.bar-cell { padding: 0 12px; }
.bar-bg {
  height: 7px;
  background: var(--line-soft);
  border-radius: var(--r-pill);
  overflow: hidden;
  min-width: 60px;
}
.bar-fill { height: 100%; background: var(--brand); border-radius: var(--r-pill); }

/* Era #ccc — 1,6:1 sobre branco. Um aviso legal que ninguem conseguia ler. */
.disclaimer {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.55;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.ilustracao {
  margin-top: 20px;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}
.ilustracao-rot {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-3);
  margin-bottom: 10px;
}

/* ── MODAL DE AVISO ──────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27,26,25,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-modal);
  padding: 32px 28px 24px;
  max-width: 24rem;
  width: 100%;
  text-align: center;
}

.modal-icon { font-size: 34px; margin-bottom: 14px; line-height: 1; }

.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 14px;
}

.modal-body {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 24px;
  text-align: left;
}
.modal-body strong { color: var(--ink); font-weight: 600; }

.modal-btn { width: 100%; }

/* Topo: voltar + wordmark. A pagina era um beco sem saida (so dava para sair
   pelo botao do browser) e nao tinha marca nenhuma. */
.res-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.res-topo .marca { font-size: 17px; }

.voltar-rats {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 10px 12px 10px 0;
  min-height: 44px;
}
.voltar-rats:hover { color: var(--brand-ink); }
