/* ==========================================================================
   Ferramentas: painel com os 4 grupos (mercado do dia, dividendos,
   analisar empresas, planejamento).
   Carregar depois de style.css e calculadora.css (usa .calc-hero e .nav-active
   de lá, e .section-eyebrow, .cta-section e .btn do style.css).
   ========================================================================== */

/* ---- Atalhos dos 4 grupos, logo abaixo do título ---- */
.fe-atalhos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}
.fe-atalhos a {
  padding: 10px 18px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: border-color .2s, color .2s;
}
.fe-atalhos a:hover { border-color: var(--green); color: var(--green); }

/* ---- Cabeçalho de cada grupo ---- */
.fe-grupo { padding: 80px 0; scroll-margin-top: 70px; }
.fe-grupo-head { margin-bottom: 36px; }
.fe-grupo-head h2 { margin-bottom: 8px; }
.fe-grupo-lead { color: var(--text-muted); font-size: 1.05rem; max-width: 640px; }

/* ---- Selic ---- */
.fe-selic {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 24px 28px;
  margin-bottom: 28px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.fe-selic-texto { display: grid; gap: 4px; max-width: 620px; }
.fe-selic-rotulo {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.fe-selic-valor {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--yellow);
}
.fe-selic-valor.is-erro { font-size: 1.05rem; font-weight: 600; color: var(--text-muted); }
.fe-selic-ajuda { color: var(--text-muted); font-size: .92rem; }
.fe-selic-fonte { color: var(--text-dim); font-size: .8rem; max-width: 300px; }

/* ---- Widgets do TradingView ---- */
.fe-widgets-duplo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}
/* min-width: 0 impede que o iframe do widget alargue a coluna do grid
   e cause rolagem lateral no celular. */
.fe-widget { min-width: 0; }
.fe-widget-titulo { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.fe-widget-ajuda { color: var(--text-muted); font-size: .92rem; margin: -4px 0 14px; max-width: 720px; }
.fe-widget-caixa {
  width: 100%;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.fe-widget-caixa .tradingview-widget-container,
.fe-widget-caixa .tradingview-widget-container__widget { width: 100%; height: 100%; }
.fe-widget-caixa iframe { display: block; max-width: 100%; }
.fe-altura-media { height: 520px; }
.fe-altura-mapa { height: 560px; }

.fe-credito { margin-top: 16px; font-size: .82rem; color: var(--text-dim); }
.fe-credito a { color: var(--text-muted); text-decoration: underline; }

/* ---- Cards de ferramenta ---- */
.fe-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.fe-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform .2s, border-color .2s;
}
a.fe-card:hover { transform: translateY(-4px); border-color: var(--green); }
.fe-card h3 { font-size: 1.2rem; font-weight: 800; line-height: 1.3; }
.fe-card p { color: var(--text-muted); font-size: .95rem; flex: 1; }
.fe-card-tag {
  align-self: flex-start;
  padding: 4px 12px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(0, 232, 164, .08);
  border: 1px solid rgba(0, 232, 164, .22);
  border-radius: 100px;
}
.fe-card-ir { font-weight: 700; color: var(--green); font-size: .95rem; }
.fe-card-ir::after { content: " \2192"; }

/* "Em breve": discreto, sem cara de botão */
.fe-card-breve { background: transparent; border-style: dashed; }
.fe-card-breve h3 { color: var(--text-muted); font-size: 1.05rem; }
.fe-card-breve p { color: var(--text-dim); }
.fe-card-breve .fe-card-tag {
  color: var(--text-dim);
  background: transparent;
  border-color: var(--border);
}

/* ---- Projeção de patrimônio ---- */
.fe-proj {
  padding: 36px;
  margin-bottom: 28px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.fe-proj-head h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.fe-proj-head p { color: var(--text-muted); max-width: 680px; margin-bottom: 24px; }

.fe-proj-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}
.fe-campo label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 8px; }
.fe-input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 14px;
  background: var(--bg-0);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
}
.fe-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(0, 232, 164, .12); }
.fe-input span { color: var(--green); font-weight: 700; white-space: nowrap; font-size: .95rem; }
.fe-input-sufixo span { color: var(--text-dim); font-weight: 600; }
.fe-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  font: 700 1.15rem var(--font);
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}
.fe-input input::placeholder { color: var(--text-dim); font-weight: 500; }
.fe-proj-btn { grid-column: 1 / -1; justify-self: start; }
.fe-proj-erro { grid-column: 1 / -1; color: var(--red); font-size: .92rem; }

.fe-proj-resultado { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--border); }
.fe-proj-numeros {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.fe-num {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.fe-num span { color: var(--text-muted); font-size: .88rem; }
.fe-num strong { font-size: 1.4rem; font-weight: 800; overflow-wrap: anywhere; }
.fe-num-destaque strong { color: var(--yellow); font-size: 1.7rem; }
.fe-verde { color: var(--green); }

.fe-grafico-legenda { display: flex; gap: 20px; font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; }
.fe-grafico-legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fe-leg-investido { background: #3b4458; }
.fe-leg-juros { background: var(--green); }
.fe-grafico svg { display: block; width: 100%; height: auto; }
.fe-grafico .fe-eixo { fill: var(--text-dim); font: 600 11px var(--font); }
.fe-proj-nota { margin-top: 16px; font-size: .85rem; color: var(--text-dim); max-width: 760px; }

/* ---- Telas menores ---- */
@media (max-width: 900px) {
  .fe-widgets-duplo { grid-template-columns: 1fr; }
  .fe-proj-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .fe-grupo { padding: 56px 0; }
  .fe-atalhos a { padding: 8px 14px; font-size: .85rem; }
  .fe-selic { padding: 20px; }
  .fe-altura-media { height: 480px; }
  .fe-altura-mapa { height: 440px; }
  .fe-proj { padding: 22px 18px; }
  .fe-proj-form { grid-template-columns: 1fr; }
  .fe-proj-btn { width: 100%; }
  .fe-proj-numeros { grid-template-columns: 1fr; }
  .fe-card { padding: 22px; }
}
