/* =========================================================
   estilo.css — visual padrão de todos os simuladores
   ========================================================= */

:root {
  --fundo: #f4f6fa;
  --painel: #ffffff;
  --borda: #dde3ec;
  --texto: #1e293b;
  --texto-suave: #5b6b82;
  --destaque: #1d4ed8;
  --cor-a: #d9480f;   /* laranja  */
  --cor-b: #0c8599;   /* azul-petróleo */
  --cor-c: #2b8a3e;   /* verde */
  --cor-curva: #1d4ed8;
  --cor-raiz: #c92a2a;
  --cor-vertice: #7048e8;
  --raio: 10px;
}

* { box-sizing: border-box; }

html { font-size: 15px; }
html.projetor { font-size: 19px; }   /* modo projetor: tudo maior */

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Topo ---------- */
.topo {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.6rem 1.2rem;
  background: #10284a;
  color: #fff;
  flex-shrink: 0;
}
.topo h1 { font-size: 1.25rem; margin: 0; font-weight: 600; flex: 1; }
.topo h1 .sub { font-weight: 400; opacity: 0.75; margin-left: 0.6rem; font-style: italic; }
.topo a.voltar { color: #cfe0ff; text-decoration: none; font-size: 0.95rem; white-space: nowrap; }
.topo a.voltar:hover { text-decoration: underline; }
.topo button {
  background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px; padding: 0.35rem 0.8rem; font-size: 0.9rem; cursor: pointer;
}
.topo button:hover { background: rgba(255,255,255,0.22); }
.topo button.ativo { background: #fff; color: #10284a; }

/* ---------- Layout principal ---------- */
.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.painel {
  background: var(--painel);
  overflow-y: auto;
  padding: 0.8rem 1rem 1.5rem;
  flex-shrink: 0;
}
.painel-esq { width: 19rem; border-right: 1px solid var(--borda); }
.painel-dir { width: 20rem; border-left: 1px solid var(--borda); }

.painel h2 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--texto-suave); margin: 1.1rem 0 0.6rem; font-weight: 700;
}
.painel h2:first-child { margin-top: 0.2rem; }

/* ---------- Área do gráfico ---------- */
.area-grafico {
  flex: 1;
  position: relative;
  min-width: 0;
  background: #fff;
}
.area-grafico canvas {
  position: absolute; inset: 0;
  cursor: grab;
  touch-action: none;
}
.area-grafico canvas.arrastando { cursor: grabbing; }

.equacao-flutuante {
  position: absolute; top: 0.8rem; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,0.94); border: 1px solid var(--borda);
  border-radius: var(--raio); padding: 0.45rem 1.1rem;
  font-size: 1.45rem; font-family: "Cambria Math", "Times New Roman", serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  pointer-events: none; white-space: nowrap;
}

.zoom {
  position: absolute; right: 0.8rem; bottom: 0.8rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.zoom button {
  width: 2.3rem; height: 2.3rem; font-size: 1.2rem; border-radius: 8px;
  border: 1px solid var(--borda); background: #fff; cursor: pointer; color: var(--texto);
}
.zoom button:hover { background: #eef3fb; }

.coordenada {
  position: absolute; left: 0.8rem; bottom: 0.8rem;
  background: rgba(255,255,255,0.94); border: 1px solid var(--borda);
  border-radius: 8px; padding: 0.3rem 0.7rem; font-size: 0.9rem;
  color: var(--texto-suave); pointer-events: none;
}
.coordenada:empty { display: none; }

/* ---------- Controles (sliders) ---------- */
.controle { margin-bottom: 1rem; }
.controle-topo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.controle-topo label {
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: 1.35rem; font-weight: 700; font-style: italic; width: 1.4rem;
}
.controle-topo input[type=number] {
  flex: 1; min-width: 0; font-size: 1rem; padding: 0.25rem 0.4rem;
  border: 1px solid var(--borda); border-radius: 6px; text-align: right;
}
.btn-animar {
  width: 2rem; height: 1.9rem; border: 1px solid var(--borda); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 0.8rem; color: var(--texto);
}
.btn-animar.ativo { background: var(--texto); color: #fff; }
.controle input[type=range] { width: 100%; height: 1.4rem; cursor: pointer; }
.controle-limites {
  display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--texto-suave);
  margin-top: -0.15rem;
}

.botao {
  display: block; width: 100%; margin-top: 0.4rem; padding: 0.45rem;
  border: 1px solid var(--borda); background: #f8fafc; border-radius: 8px;
  cursor: pointer; font-size: 0.92rem; color: var(--texto);
}
.botao:hover { background: #eef3fb; }
.botoes-lado { display: flex; gap: 0.4rem; }
.botoes-lado .botao { flex: 1; }

.opcao { display: flex; align-items: center; gap: 0.5rem; margin: 0.35rem 0; cursor: pointer; font-size: 0.95rem; }
.opcao input { width: 1.05rem; height: 1.05rem; cursor: pointer; }
.amostra { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; }

.dica { font-size: 0.82rem; color: var(--texto-suave); line-height: 1.4; margin: 0.5rem 0 0; }

/* ---------- Cartões de informação ---------- */
.cartao {
  border: 1px solid var(--borda); border-radius: var(--raio);
  padding: 0.6rem 0.8rem; margin-bottom: 0.6rem; background: #fbfcfe;
}
.cartao h3 {
  margin: 0 0 0.25rem; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--texto-suave); font-weight: 700;
}
.cartao .valor { font-size: 1.15rem; font-family: "Cambria Math", "Times New Roman", serif; }
.cartao .explica { font-size: 0.86rem; color: var(--texto-suave); margin: 0.3rem 0 0; line-height: 1.4; }
.cartao.alerta { border-color: #f0b429; background: #fff9e6; }

.mat { font-family: "Cambria Math", "Times New Roman", serif; }
.ca { color: var(--cor-a); font-weight: 700; }
.cb { color: var(--cor-b); font-weight: 700; }
.cc { color: var(--cor-c); font-weight: 700; }
.positivo { color: #2b8a3e; font-weight: 600; }
.negativo { color: #c92a2a; font-weight: 600; }

/* ---------- Telas menores: empilha os painéis ---------- */
@media (max-width: 1000px) {
  body { height: auto; overflow: auto; }
  .layout { flex-direction: column; }
  .painel-esq, .painel-dir { width: 100%; border: none; }
  .area-grafico { height: 70vh; flex: none; }
}

/* ---------- Acréscimos (simuladores de física) ---------- */
.controle-topo label.longo { width: auto; font-size: 1rem; font-family: inherit; font-style: normal; }
.unidade { font-size: 0.85rem; color: var(--texto-suave); min-width: 1.6rem; }

.segmentado { display: flex; border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; margin-bottom: 0.7rem; }
.segmentado button {
  flex: 1; border: none; background: #f8fafc; padding: 0.45rem 0.3rem; cursor: pointer;
  font-size: 0.9rem; color: var(--texto); border-right: 1px solid var(--borda);
}
.segmentado button:last-child { border-right: none; }
.segmentado button:hover { background: #eef3fb; }
.segmentado button.ativo { background: var(--destaque); color: #fff; font-weight: 600; }

.botao.primario { background: var(--destaque); color: #fff; border-color: var(--destaque); font-weight: 600; }
.botao.primario:hover { background: #1e40af; }

.progresso { height: 6px; background: #e5e9f0; border-radius: 3px; overflow: hidden; margin-top: 0.6rem; }
.progresso div { height: 100%; width: 0; background: var(--destaque); }

.tabela-casos { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.tabela-casos th { text-align: left; color: var(--texto-suave); font-weight: 600; padding: 0.2rem 0.25rem; border-bottom: 1px solid var(--borda); }
.tabela-casos td { padding: 0.3rem 0.25rem; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.tabela-casos tr.atual td { background: #e7efff; font-weight: 600; }

.caracteristicas { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.35rem; margin-top: 0.2rem; }
.selo { text-align: center; border-radius: 8px; padding: 0.4rem 0.2rem; font-weight: 700; font-size: 0.92rem; background: #eef1f6; color: var(--texto-suave); }
.selo small { display: block; font-weight: 500; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.8; }
.selo.real { background: #e6f4ea; color: #1b6b30; }
.selo.virtual { background: #f3e8ff; color: #6b21a8; }
.selo.neutro { background: #fff4e0; color: #9a5b00; }

.linha-valor { display: flex; justify-content: space-between; padding: 0.18rem 0; border-bottom: 1px dashed #edf0f4; font-size: 0.95rem; }
.linha-valor span:first-child { color: var(--texto-suave); }
.linha-valor b { font-family: "Cambria Math", "Times New Roman", serif; font-size: 1.05rem; }

canvas.mini { width: 100%; height: 13rem; display: block; border: 1px solid var(--borda); border-radius: 8px; background: #fff; }

/* ---------- Navegação entre simuladores (comum/navegacao.js) ---------- */
.nav-trilha { display: flex; align-items: center; gap: 0.15rem; font-size: 0.9rem; white-space: nowrap; }
.nav-trilha a { color: #cfe0ff; text-decoration: none; padding: 0.2rem 0.35rem; border-radius: 5px; }
.nav-trilha a:hover { background: rgba(255,255,255,0.14); color: #fff; }
.nav-sep { opacity: 0.5; }
.topo .nav-botao { font-weight: 600; }
.nav-painel {
  display: none; position: fixed; top: 3.1rem; right: 1rem; z-index: 50;
  width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 4.5rem); overflow-y: auto;
  background: #fff; border: 1px solid var(--borda); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(16,40,74,0.22); padding: 0.9rem 1rem 1rem;
}
.nav-painel.aberto { display: block; animation: navSurge 0.14s ease-out; }
@keyframes navSurge { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.nav-painel-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; font-size: 0.95rem; }
.nav-painel-topo a { color: var(--destaque); text-decoration: none; font-size: 0.88rem; }
.nav-painel-topo a:hover { text-decoration: underline; }
.nav-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.nav-area-titulo { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.4rem; padding-bottom: 0.3rem; border-bottom: 2px solid #eef2f7; }
.nav-grupo { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texto-suave); margin: 0.7rem 0 0.25rem; }
.nav-sim { display: flex; align-items: center; gap: 0.55rem; padding: 0.4rem 0.45rem; border-radius: 8px;
           text-decoration: none; color: var(--texto); font-size: 0.92rem; }
.nav-sim:hover { background: #eef3fb; }
.nav-sim.atual { background: #e7efff; font-weight: 600; }
.nav-sim small { color: var(--texto-suave); font-weight: 400; }
.nav-icone { flex-shrink: 0; width: 1.8rem; height: 1.8rem; border-radius: 7px; color: #fff; display: flex;
             align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700;
             font-family: "Cambria Math", "Times New Roman", serif; }
@media (max-width: 700px) { .nav-colunas { grid-template-columns: 1fr; } }

/* caixa numérica dos controles: sempre com espaço para pelo menos 5 caracteres */
.controle-topo input[type=number] { min-width: 4.6rem; }
.controle-topo label.longo { flex: 0 1 auto; line-height: 1.15; }
