/* monitoramento-de-ti — estilo exclusivo desta tela.
   O que e reaproveitado por mais de uma pagina mora em css/style.css,
   que carrega antes deste. */
/* ===== 25-cena-monitoramento.css ===== */
/* Cena da hero nova de /solucoes/monitoramento-de-ti/: as metricas ao vivo.

   Tres linhas se desenham da esquerda para a direita, com um ponto correndo na
   ponta de cada uma. A do disco sobe, cruza o limiar tracejado — e nesse
   instante o selo dela vira alerta — e depois cai sozinha: a auto-recuperacao
   agiu antes de virar chamado.

   Os instantes dos selos nao foram escolhidos a mao: saem de onde a propria
   linha cruza o limiar, entao o selo nunca acende fora de hora. O tracejado de
   revelacao e o `offset-distance` do ponto andam pelo mesmo comprimento de
   caminho, e por isso o ponto fica sempre na ponta do traco.

   Todas as medidas sao `cqw`, a largura da propria cena. */
.mon-cena {
  position: relative;
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
  aspect-ratio: 400 / 400;
  container-type: inline-size;
}

.mon-fundo {
  position: absolute;
  inset: -4%;
  background:
    radial-gradient(circle at 26% 24%, rgba(57, 150, 216, 0.14), transparent 50%),
    radial-gradient(circle at 76% 76%, rgba(22, 163, 74, 0.08), transparent 46%);
  filter: blur(6px);
}

/* --- Os cartoes de metrica --- */
.mon-lista {
  list-style: none;
}

.mon-metrica {
  position: absolute;
  left: 0;
  right: 0;
  height: 31.0cqw;
  padding: 3cqw;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1.4cqw 3cqw rgba(15, 23, 42, 0.06);
}

.mon-topo {
  display: flex;
  align-items: center;
  gap: 2cqw;
}

.mon-topo > i {
  font-size: 2.6cqw;
  color: #94a3b8;
}

.mon-nome {
  flex: 1;
  min-width: 0;
  font-size: 2.4cqw;
  font-weight: 700;
  color: #334155;
}

/* Os selos do disco ocupam a mesma celula: um troca pelo outro sem mexer na
   largura do cartao. */
.mon-selos {
  display: inline-grid;
  justify-items: end;
}

.mon-selos > * {
  grid-area: 1 / 1;
}

.mon-selo {
  padding: 0.7cqw 1.8cqw;
  border-radius: 9999px;
  border: 1px solid transparent;
  font-size: 1.7cqw;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mon-selo-ok,
.mon-selo-normal {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.mon-selo-alerta {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
  opacity: 0;
  animation: mon-selo-alerta 15s ease-out infinite;
}

.mon-selo-resolvido {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
  opacity: 0;
  animation: mon-selo-resolvido 15s ease-out infinite;
}

.mon-selo-normal {
  animation: mon-selo-normal 15s ease-out infinite;
}

@keyframes mon-selo-normal {
  0%,
  39.46% {
    opacity: 1;
  }

  40.46%,
  100% {
    opacity: 0;
  }
}

@keyframes mon-selo-alerta {
  0%,
  39.46% {
    opacity: 0;
  }

  40.46%,
  63.77% {
    opacity: 1;
  }

  64.77%,
  100% {
    opacity: 0;
  }
}

@keyframes mon-selo-resolvido {
  0%,
  63.77% {
    opacity: 0;
  }

  64.77%,
  98.0% {
    opacity: 1;
  }

  99.0%,
  100% {
    opacity: 0;
  }
}

/* --- Os graficos --- */
.mon-grafico {
  display: block;
  width: 100%;
  margin-top: 2.4cqw;
  overflow: visible;
}

.mon-limiar {
  stroke: #cbd5e1;
  stroke-width: 0.22;
  stroke-dasharray: 0.9 1.1;
}

/* A linha se revela: o tracejado tem o comprimento do caminho inteiro e o
   deslocamento vai de tudo escondido a nada escondido. */
.mon-linha {
  fill: none;
  stroke: #3996d8;
  stroke-width: 0.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* O ponto que corre na ponta do traco. */
.mon-ponta {
  fill: #3996d8;
  offset-rotate: 0deg;
  opacity: 0;
}

@keyframes mon-corre {
  0%,
  3.0% {
    offset-distance: 0%;
    opacity: 0;
  }

  4.0% {
    opacity: 1;
  }

  82.0% {
    offset-distance: 100%;
    opacity: 1;
  }

  84.0%,
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

/* A linha do disco muda de cor quando cruza o limiar, e volta ao voltar. */
@keyframes mon-cor-disco {
  0%,
  39.46% {
    stroke: #3996d8;
  }

  39.96%,
  63.77% {
    stroke: #f59e0b;
  }

  64.77%,
  100% {
    stroke: #16a34a;
  }
}

@keyframes mon-cor-ponta {
  0%,
  39.46% {
    fill: #3996d8;
  }

  39.96%,
  63.77% {
    fill: #f59e0b;
  }

  64.77%,
  100% {
    fill: #16a34a;
  }
}

/* --- A legenda, que conta em que ato a cena esta --- */
.mon-legenda {
  position: absolute;
  top: 103.0cqw;
  left: 0;
  right: 0;
  display: inline-grid;
  justify-items: center;
}

.mon-legenda > * {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 1.4cqw;
  padding: 1.4cqw 3cqw;
  border-radius: 9999px;
  border: 1px solid transparent;
  font-size: 2.1cqw;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mon-legenda-calmo {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.mon-legenda-alerta {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
  opacity: 0;
}

.mon-legenda-fim {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
  opacity: 0;
}

.mon-metrica-cpu {
  top: 0.0cqw;
}

.mon-linha-cpu {
  stroke-dasharray: 105.15;
  stroke-dashoffset: 105.15;
  animation: mon-desenha-cpu 15s linear infinite;
}

@keyframes mon-desenha-cpu {
  0%,
  3.0% {
    stroke-dashoffset: 105.15;
    opacity: 1;
  }

  82.0%,
  92.0% {
    stroke-dashoffset: 0;
    opacity: 1;
  }

  97.99% {
    stroke-dashoffset: 0;
    opacity: 0;
  }

  98.0%,
  100% {
    stroke-dashoffset: 105.15;
    opacity: 0;
  }
}

.mon-ponta-cpu {
  animation: mon-corre 15s linear infinite;
}

.mon-metrica-disco {
  top: 34.5cqw;
}

.mon-linha-disco {
  stroke-dasharray: 103.48;
  stroke-dashoffset: 103.48;
  animation: mon-desenha-disco 15s linear infinite, mon-cor-disco 15s linear infinite;
}

@keyframes mon-desenha-disco {
  0%,
  3.0% {
    stroke-dashoffset: 103.48;
    opacity: 1;
  }

  82.0%,
  92.0% {
    stroke-dashoffset: 0;
    opacity: 1;
  }

  97.99% {
    stroke-dashoffset: 0;
    opacity: 0;
  }

  98.0%,
  100% {
    stroke-dashoffset: 103.48;
    opacity: 0;
  }
}

.mon-ponta-disco {
  animation: mon-corre 15s linear infinite, mon-cor-ponta 15s linear infinite;
}

.mon-metrica-link {
  top: 69.0cqw;
}

.mon-linha-link {
  stroke-dasharray: 103.77;
  stroke-dashoffset: 103.77;
  animation: mon-desenha-link 15s linear infinite;
}

@keyframes mon-desenha-link {
  0%,
  3.0% {
    stroke-dashoffset: 103.77;
    opacity: 1;
  }

  82.0%,
  92.0% {
    stroke-dashoffset: 0;
    opacity: 1;
  }

  97.99% {
    stroke-dashoffset: 0;
    opacity: 0;
  }

  98.0%,
  100% {
    stroke-dashoffset: 103.77;
    opacity: 0;
  }
}

.mon-ponta-link {
  animation: mon-corre 15s linear infinite;
}

.mon-legenda-calmo {
  animation: mon-legenda-calmo 15s ease-out infinite;
}

@keyframes mon-legenda-calmo {
  0%,
  39.46% {
    opacity: 1;
  }

  40.96%,
  98.0% {
    opacity: 0;
  }

  99.0%,
  100% {
    opacity: 1;
  }
}

.mon-legenda-alerta {
  animation: mon-legenda-alerta 15s ease-out infinite;
}

@keyframes mon-legenda-alerta {
  0%,
  39.46% {
    opacity: 0;
  }

  40.96%,
  63.77% {
    opacity: 1;
  }

  65.27%,
  100% {
    opacity: 0;
  }
}

.mon-legenda-fim {
  animation: mon-legenda-fim 15s ease-out infinite;
}

@keyframes mon-legenda-fim {
  0%,
  63.77% {
    opacity: 0;
  }

  65.27%,
  98.0% {
    opacity: 1;
  }

  99.0%,
  100% {
    opacity: 0;
  }
}

/* Quem pediu menos movimento ve as tres linhas inteiras e o desfecho. */
@media (prefers-reduced-motion: reduce) {
  .mon-cena * {
    animation: none !important;
  }

  .mon-linha {
    stroke-dashoffset: 0;
  }

  .mon-linha-disco {
    stroke: #16a34a;
  }

  .mon-ponta,
  .mon-selo-normal,
  .mon-selo-alerta,
  .mon-legenda-calmo,
  .mon-legenda-alerta {
    opacity: 0;
  }

  .mon-selo-resolvido,
  .mon-legenda-fim {
    opacity: 1;
  }
}

