/* Diagrama de integração dos módulos do OpenPrev */
.opm { display: none; }
.opm-mobile { display: block; }
.op-modules-grid.opm-mobile { display: grid; }

@media (min-width: 992px) {
  .opm { display: block; }
  .opm-mobile, .op-modules-grid.opm-mobile { display: none; }
}

.opm-stage {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  aspect-ratio: 100 / 50;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(46, 196, 190, 0.18) 0%, rgba(46, 196, 190, 0) 45%),
    linear-gradient(135deg, #0a2a5e 0%, #06183a 100%);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 41, 97, 0.25);
}
.opm-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}
.opm-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56%;
  height: 66%;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  pointer-events: none;
}
.opm-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.opm-lines line {
  stroke: rgba(90, 209, 208, 0.55);
  stroke-width: 1.2;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
  animation: opm-flow 2.4s linear infinite;
}
.opm-lines line.is-active {
  stroke: #5ad1d0;
  stroke-width: 2.2;
}
@keyframes opm-flow {
  to { stroke-dashoffset: -20; }
}

.opm-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20%;
  aspect-ratio: 1;
  min-width: 128px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #2ec4be 0%, #1d8b8a 45%, #0a4f7a 100%);
  box-shadow: 0 0 0 10px rgba(46, 196, 190, 0.12), 0 0 40px rgba(46, 196, 190, 0.55);
  z-index: 2;
}
.opm-center strong { font-size: 20px; line-height: 1.1; font-weight: 700; color: #fff; }
.opm-center span { font-size: 11.5px; line-height: 1.25; opacity: 0.92; margin-top: 4px; padding: 0 12px; }

.opm-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 140px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  z-index: 3;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.opm-node i { font-size: 16px; color: #5ad1d0; width: 20px; text-align: center; flex: none; }
.opm-node:hover, .opm-node:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(90, 209, 208, 0.8);
  outline: none;
}
.opm-node.is-active {
  background: #fff;
  color: #002961;
  border-color: #5ad1d0;
  box-shadow: 0 0 22px rgba(90, 209, 208, 0.6);
}
.opm-node.is-active i { color: #1d8b8a; }

.opm-panel {
  max-width: 1000px;
  margin: 12px auto 0;
  padding: 16px 22px;
  background: #fff;
  border: 1px solid #E7ECEF;
  border-left: 4px solid #1d8b8a;
  border-radius: 14px;
  min-height: 84px;
}
.opm-panel h4 { font-size: 18px; margin: 0 0 6px; color: #002961; }
.opm-panel p { margin: 0; color: #0e0e0e; line-height: 1.55; font-size: 15px; }
.opm-hint { text-align: center; margin-top: 8px; margin-bottom: 0; font-size: 14px; color: #5b6b7a; }

/* círculo central clicável (mostra o resumo da solução) */
button.opm-center { border: 0; padding: 0; font-family: inherit; cursor: pointer; transition: box-shadow .25s ease, transform .25s ease; }
button.opm-center:hover { transform: translate(-50%, -50%) scale(1.04); }
button.opm-center:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
button.opm-center.is-active { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 0 0 14px rgba(46, 196, 190, 0.2), 0 0 50px rgba(46, 196, 190, 0.75); }

/* telas baixas (notebooks): diagrama + resumo na mesma tela, sem rolagem */
@media (min-width: 992px) and (max-height: 700px) {
  .opm-stage { max-width: 780px; }
  .opm-node { width: 126px; min-height: 40px; padding: 6px 8px; font-size: 12.5px; }
  .opm-center { min-width: 112px; }
  .opm-center strong { font-size: 18px; }
  .opm-center span { font-size: 10.5px; padding: 0 8px; }
  .opm-panel { padding: 12px 18px; min-height: 0; }
  .opm-panel p { font-size: 14px; line-height: 1.45; }
}
