/* ============================================================================
   HELIX BASE aplicado ao sistema PAF Bom Pastor
   Adaptado de helix-base.css (SEGTotal): as mesmas regras de tipografia,
   animação e micro-interação, porém na marca VERDE e mantendo as fontes
   Poppins/Montserrat já escolhidas. Carregar DEPOIS de estilo.css.
   ========================================================================= */

:root{
  --h-principal:#0c8a41;        /* verde de ação */
  --h-principal-forte:#076a31;
  --h-principal-claro:#4fc07f;
}

/* ============================================================================
   1. TIPOGRAFIA — as 3 regras
   Regra 1: texto grande pede espaçamento NEGATIVO.
   (Regra 2 — maiúscula pequena espaçada — e tabular-nums já existem no
   estilo.css: .kpi .rotulo, table.tab th e .num.)
   ========================================================================= */
.kpi .valor{ letter-spacing:-.7px }
.h-pagina, .cabecalho h1, .conteudo > h1{ letter-spacing:-.4px }
.modal-topo h3{ letter-spacing:-.2px }

/* iPhone dá zoom sozinho em campo com menos de 16px */
@media (max-width:860px){
  input, select, textarea{ font-size:16px }
}

/* ============================================================================
   2. ANIMAÇÕES
   ========================================================================= */
@keyframes h-fadeUp{ from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
@keyframes h-girar{ to{ transform:rotate(360deg) } }

.anim-sobe   { animation:h-fadeUp .35s ease }
.anim-sobe-r { animation:h-fadeUp .2s  ease }

/* toda tela nova e todo modal sobem ao aparecer */
.modal{ animation:h-fadeUp .25s ease }

/* rodinha de carregando */
.girando{
  display:inline-block;width:16px;height:16px;border-radius:50%;
  border:2.5px solid var(--linha);
  border-top-color:var(--h-principal);
  animation:h-girar .8s linear infinite;
  vertical-align:-3px;
}
.carregando{
  display:flex;align-items:center;justify-content:center;gap:10px;
  padding:26px 14px;color:var(--tinta-3);font-size:13.5px;
}

/* ============================================================================
   3. PÍLULA DESLIZANTE — menu lateral
   O item aberto NÃO pinta fundo próprio: quem pinta é a pílula. Se os dois
   pintassem, apareceriam dois retângulos durante o trajeto.
   ========================================================================= */
/* NÃO declarar position aqui: o menu já é position:fixed no estilo.css, e
   fixed por si só serve de referência para a pílula (absolute). Trocar para
   relative jogaria o menu de volta no fluxo e empurraria o conteúdo. */

.pilula-v{
  position:absolute;left:10px;right:10px;top:0;height:0;
  border-radius:9px;
  background:rgba(12,138,65,.10);
  border-left:3px solid var(--h-principal);
  transform:translateY(0);
  opacity:0;pointer-events:none;z-index:0;
  transition:transform .4s cubic-bezier(.34,1.32,.64,1),
             height .2s ease,
             opacity .2s ease;
}
.pilula-v.on{ opacity:1 }

.barra-nav-lateral button{ position:relative;z-index:1 }
/* sem fundo próprio no item ativo — a pílula é que pinta */
.barra-nav-lateral button.sel{
  background:transparent;
  color:var(--h-principal-forte);
  font-weight:700;
}
.barra-nav-lateral button.sel:hover{ background:transparent }

[data-tema="escuro"] .pilula-v{
  background:rgba(79,192,127,.13);
  border-left-color:var(--h-principal-claro);
}
[data-tema="escuro"] .barra-nav-lateral button.sel{ color:var(--h-principal-claro) }

/* ============================================================================
   4. MICRO-INTERAÇÕES — movimento de 1 a 3px
   ========================================================================= */
.btn{ transition:transform .18s, filter .18s, background .18s }
.btn:hover { transform:translateY(-1px); filter:brightness(1.06) }
.btn:active{ transform:none }

table.tab tbody tr[data-i]{ transition:background .15s }
.cartao.clicavel{ cursor:pointer;transition:transform .18s }
.cartao.clicavel:hover{ transform:translateY(-3px) }

/* foco sempre visível, na cor de ação */
input:focus, select:focus, textarea:focus{
  outline:none;
  border-color:var(--h-principal);
  box-shadow:0 0 0 3px rgba(12,138,65,.14);
}

/* ============================================================================
   5. QUEM PEDIU PARA REDUZIR MOVIMENTO
   ========================================================================= */
@media (prefers-reduced-motion:reduce){
  .pilula-v{ transition-duration:.01ms }
  .anim-sobe, .anim-sobe-r, .modal{ animation-duration:.01ms }
  .girando{ animation-duration:2s }
  .btn:hover, .cartao.clicavel:hover{ transform:none }
}

/* ============================================================================
   6. PÍLULA DESLIZANTE — barra de baixo (celular)
   Mesma ideia da vertical, só que ela anda na horizontal. A barra já é
   position:fixed, então serve de referência para a pílula (absolute).
   Como a barra é flex, a pílula PRECISA ser absolute — senão ela vira mais
   um item e rouba espaço dos botões.
   ========================================================================= */
.pilula-h{
  position:absolute;
  top:5px;bottom:calc(5px + env(safe-area-inset-bottom));
  left:0;width:0;
  border-radius:12px;
  background:rgba(12,138,65,.10);
  transform:translateX(0);
  opacity:0;pointer-events:none;z-index:0;
  transition:transform .4s cubic-bezier(.34,1.32,.64,1),
             width .2s ease,
             opacity .2s ease;
}
.pilula-h.on{ opacity:1 }

.nav-inferior button{ position:relative;z-index:1 }
/* o item aberto não pinta fundo: quem pinta é a pílula */
.nav-inferior button.sel,
.nav-inferior button.sel .rot{ color:var(--h-principal-forte) }
.nav-inferior button .ic{ transition:transform .3s cubic-bezier(.34,1.32,.64,1) }
.nav-inferior button.sel .ic{ transform:translateY(-1px) }

[data-tema="escuro"] .pilula-h{ background:rgba(79,192,127,.13) }
[data-tema="escuro"] .nav-inferior button.sel,
[data-tema="escuro"] .nav-inferior button.sel .rot{ color:var(--h-principal-claro) }

@media (prefers-reduced-motion:reduce){
  .pilula-h{ transition-duration:.01ms }
  .nav-inferior button .ic{ transition:none }
}

/* ============================================================================
   7. PESO DAS LETRAS
   O texto estava fino demais por dois motivos somados:
   (a) o corpo do site usava peso 400, o mais leve que carregamos;
   (b) o "font-smoothing: antialiased" afina as letras no Windows.
   Aqui o corpo sobe para 500 e o smoothing volta ao normal do sistema.
   Só usamos pesos que a fonte realmente tem (400/500/600/700) — pedir 800
   faria o navegador ENGROSSAR na força bruta, e fica borrado.
   ========================================================================= */
body{
  font-weight:500;
  -webkit-font-smoothing:auto;
  -moz-osx-font-smoothing:auto;
}

/* títulos */
h1,h2,h3,h4,
.modal-topo h3,
.cabecalho-pagina h2,
.cartao-topo h3{ font-weight:700 }

/* números grandes dos quadrinhos */
.kpi .valor{ font-weight:700 }
.kpi .sub  { font-weight:500 }

/* tabelas: o conteúdo em 500, e número/dinheiro um pouco mais forte */
table.tab td        { font-weight:500 }
table.tab td.num    { font-weight:600 }
table.tab td b,
table.tab td strong { font-weight:700 }

/* listas e fichas */
.lista .principal              { font-weight:700 }
.lista .secundario             { font-weight:500 }
.linha-dado span:first-child   { font-weight:500 }
.linha-dado span:last-child    { font-weight:700 }
.vazio                         { font-weight:500 }
.cabecalho-pagina p,
.cartao-topo .sub              { font-weight:500 }

/* botões, menus e campos */
.btn                           { font-weight:700 }
.barra-nav-lateral button      { font-weight:600 }
.nav-inferior button .rot      { font-weight:700 }
.item-menu .rot                { font-weight:600 }
input,select,textarea,
.filtros input,.filtros select { font-weight:500 }

/* o carnê e o cartão saem impressos: mantêm o peso original para não
   borrar no papel */
.carne-parcela, .cartao-beneficio{ font-weight:400 }
