/* assets/css/diagrama.css -- diagramas (app/diagrama.php) e mini visuais
   (parciais/mini-visual.php). O SVG sai do PHP no estado final, tudo
   aceso; o diagrama.js anima com GSAP. Os mini visuais animam so com
   CSS. So transform, opacity e traco animam. */

.diagrama { display: block; width: 100%; height: auto; overflow: visible; }
.diagrama text { font-family: var(--f-titulo); font-synthesis: none; }
.diagrama__linha { stroke: var(--borda-forte); }
.diagrama__trilha { stroke-dasharray: 100 100; stroke-dashoffset: 0; opacity: 0.55; }
.diagrama__pulso { stroke-dasharray: 16 120; stroke-dashoffset: 20; }
.diagrama__pulso--halo { opacity: 0.22; }
.diagrama__caixa { fill: var(--superficie); stroke: var(--borda); }
.diagrama__icone-caixa { fill: var(--vela); stroke: var(--borda); }
.diagrama__icone { stroke: var(--texto-2); }
.diagrama__rotulo { fill: var(--texto); font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
.diagrama__detalhe { fill: var(--texto-2); font-family: var(--f-mono) !important; font-size: 11.5px; }
.diagrama__rotulo-aresta {
  fill: var(--texto-2);
  font-family: var(--f-mono) !important;
  font-size: 11px;
  paint-order: stroke;
  stroke: var(--fundo);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.diagrama__brilho { stroke: var(--ok); opacity: 0.55; }
.diagrama__check circle { fill: var(--fundo); stroke: var(--ok); }
.diagrama__check path { stroke: var(--ok); }

/* ---------- Mini visuais dos cards de solucoes ----------------- */
.mini { display: block; width: 100%; height: auto; }
.mini text { font-family: var(--f-mono); font-size: 10px; font-synthesis: none; letter-spacing: 0.06em; fill: var(--texto-2); }
.mini .m-moldura { fill: var(--fundo); stroke: var(--borda); }
.mini .m-borda { fill: none; stroke: var(--borda-forte); }
.mini .m-barra { fill: var(--borda-forte); }
.mini .m-barra--clara { fill: var(--texto-2); opacity: 0.5; }
.mini .m-ok { fill: none; stroke: var(--ok); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mini .m-ok-fundo { fill: rgb(43 217 160 / 0.1); stroke: var(--ok); }
.mini .m-texto-ok { fill: var(--ok); }
.mini .m-anel { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
.mini .m-linha { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
.mini [class*="m-a-"] { transform-box: fill-box; animation-duration: 4.8s; animation-iteration-count: infinite; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
.mini--fora [class*="m-a-"] { animation-play-state: paused; }

/* Pix: o anel fecha, o check entra, "processando" vira "aprovado". */
.m-a-anel { animation-name: m-anel; }
.m-a-surge { transform-origin: center; animation-name: m-surge; }
.m-a-sai { animation-name: m-sai; }
@keyframes m-anel { 0%, 8% { stroke-dashoffset: 100; } 42%, 90% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes m-surge { 0%, 44% { opacity: 0; transform: scale(0.6); } 54%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes m-sai { 0%, 40% { opacity: 1; } 48%, 100% { opacity: 0; } }

/* Nota: as linhas se escrevem uma a uma e o selo carimba. */
.m-a-escreve { transform-origin: left center; animation-name: m-escreve; }
.m-a-escreve:nth-of-type(2) { animation-name: m-escreve-2; }
.m-a-escreve:nth-of-type(3) { animation-name: m-escreve-3; }
.m-a-escreve:nth-of-type(4) { animation-name: m-escreve-4; }
@keyframes m-escreve { 0%, 6% { transform: scaleX(0); } 18%, 92% { transform: none; opacity: 1; } 100% { opacity: 0; } }
@keyframes m-escreve-2 { 0%, 14% { transform: scaleX(0); } 26%, 92% { transform: none; opacity: 1; } 100% { opacity: 0; } }
@keyframes m-escreve-3 { 0%, 22% { transform: scaleX(0); } 34%, 92% { transform: none; opacity: 1; } 100% { opacity: 0; } }
@keyframes m-escreve-4 { 0%, 30% { transform: scaleX(0); } 42%, 92% { transform: none; opacity: 1; } 100% { opacity: 0; } }

/* Painel: barras sobem, a linha se desenha, o indicador acende. */
.m-a-sobe { transform-origin: bottom; animation-name: m-sobe; }
.m-a-sobe:nth-of-type(2) { animation-delay: 80ms; }
.m-a-sobe:nth-of-type(3) { animation-delay: 160ms; }
.m-a-sobe:nth-of-type(4) { animation-delay: 240ms; }
.m-a-sobe:nth-of-type(5) { animation-delay: 320ms; }
.m-a-sobe:nth-of-type(6) { animation-delay: 400ms; }
.m-a-traco { animation-name: m-anel; }
@keyframes m-sobe { 0%, 6% { transform: scaleY(0.08); } 30%, 92% { transform: none; opacity: 1; } 100% { transform: none; opacity: 0.3; } }

@media (prefers-reduced-motion: reduce) {
  .mini [class*="m-a-"] { animation: none !important; }
  .m-a-sai { opacity: 0; }
}
