/* Webiness — Marketing Automation: componente quadrato "Flusso automatico" */

.mau-flow-animation {
  --mau-ink: #0d1628;
  --mau-line: #d8dfeb;
  --mau-white: #ffffff;
  --mau-brand: #cc0090;
  --mau-brand-light: #ffe8f8;
  --mau-shadow: 0 22px 50px rgba(13, 22, 40, .12);
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  max-width: 440px;
  min-height: 440px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #dfe5ef;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 50%, rgba(204, 0, 144, .10), transparent 26%),
    linear-gradient(rgba(13, 22, 40, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 22, 40, .035) 1px, transparent 1px),
    var(--mau-white);
  background-size: auto, 24px 24px, 24px 24px, auto;
  box-shadow: var(--mau-shadow);
  color: var(--mau-ink);
  font-family: Nunito, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mau-flow-animation *,
.mau-flow-animation *::before,
.mau-flow-animation *::after { box-sizing: border-box; }

.mau-flow-animation::after {
  position: absolute;
  z-index: -1;
  right: -110px;
  bottom: -150px;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(204, 0, 144, .14), rgba(204, 0, 144, 0) 68%);
  content: "";
}

/* ── barra superiore ── */
.mau-board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 20px;
  border-bottom: 1px solid var(--mau-line);
  background: rgba(255, 255, 255, .82);
  color: var(--mau-ink);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.mau-board-name { display: flex; align-items: center; gap: 9px; }

.mau-board-name::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mau-brand);
  box-shadow: 0 0 0 5px var(--mau-brand-light);
  content: "";
}

.mau-active {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #16835c;
}

.mau-active i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25aa78;
  animation: mau-blink 1.7s ease-in-out infinite;
}

/* ── area del ciclo ── */
.mau-stage {
  position: relative;
  height: 330px;
}

.mau-loop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.mau-loop-base { fill: none; stroke: #cbd5e3; stroke-width: 1.5; }

.mau-loop-signal {
  fill: none;
  stroke: var(--mau-brand);
  stroke-linecap: round;
  stroke-width: 2.5;
  stroke-dasharray: 3 11;
  animation: mau-run 2.6s linear infinite;
}

.mau-loop-arrow { fill: #b7c2d2; }

/* ── nodi del ciclo ── */
.mau-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 137px;
  padding: 10px 11px;
  border: 1px solid var(--mau-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 18px rgba(13, 22, 40, .055);
  color: #46536a;
  font-size: .72rem;
  font-weight: 800;
}

.mau-node b {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: #eef2f8;
  color: var(--mau-ink);
  font-size: .65rem;
}

.mau-node small {
  display: block;
  margin-top: 2px;
  color: #7d8799;
  font-size: .61rem;
  font-weight: 700;
}

.mau-node--track { top: 6px; left: 14px; }
.mau-node--profile { top: 6px; right: 14px; }
.mau-node--segment { right: 14px; bottom: 6px; }
.mau-node--engage { bottom: 6px; left: 14px; }

.mau-node--track { animation: mau-step 8s linear infinite; }
.mau-node--profile { animation: mau-step 8s 2s linear infinite; }
.mau-node--segment { animation: mau-step 8s 4s linear infinite; }
.mau-node--engage { animation: mau-step 8s 6s linear infinite; }

.mau-node--track b { animation: mau-step-badge 8s linear infinite; }
.mau-node--profile b { animation: mau-step-badge 8s 2s linear infinite; }
.mau-node--segment b { animation: mau-step-badge 8s 4s linear infinite; }
.mau-node--engage b { animation: mau-step-badge 8s 6s linear infinite; }

/* ── motore centrale ── */
.mau-core {
  position: absolute;
  top: 90px;
  left: 50%;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  transform: translateX(-50%);
}

.mau-core::before,
.mau-core::after {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(204, 0, 144, .24);
  border-radius: 50%;
  content: "";
}

.mau-core::before { animation: mau-radar 3.4s ease-out infinite; }
.mau-core::after { animation: mau-radar 3.4s 1.7s ease-out infinite; }

.mau-core-card {
  position: relative;
  z-index: 2;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid #f0b5dc;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff 0%, #fff0fc 100%);
  box-shadow: 0 14px 29px rgba(204, 0, 144, .19);
  text-align: center;
}

.mau-core-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--mau-brand);
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
}

.mau-core-card strong {
  display: block;
  margin-top: 5px;
  color: var(--mau-ink);
  font-size: .67rem;
  line-height: 1.1;
}

.mau-core-card span {
  display: block;
  margin-top: 3px;
  color: var(--mau-brand);
  font-size: .53rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── barra inferiore ── */
.mau-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 54px;
  padding: 0 21px;
  border-top: 1px solid var(--mau-line);
}

.mau-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #16835c;
  font-size: .64rem;
  font-weight: 800;
}

.mau-status::before {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #e7f8f0;
  content: "✓";
  font-size: .65rem;
}

.mau-metric {
  color: #7d8799;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.mau-metric b {
  color: var(--mau-brand);
  font-size: .72rem;
  font-weight: 900;
}

.mau-flow-animation:not(.is-visible) .mau-loop-signal,
.mau-flow-animation:not(.is-visible) .mau-core::before,
.mau-flow-animation:not(.is-visible) .mau-core::after,
.mau-flow-animation:not(.is-visible) .mau-active i,
.mau-flow-animation:not(.is-visible) .mau-node,
.mau-flow-animation:not(.is-visible) .mau-node b { animation-play-state: paused; }

@keyframes mau-run { to { stroke-dashoffset: -28; } }
@keyframes mau-blink { 50% { opacity: .3; transform: scale(.78); } }
@keyframes mau-radar {
  0% { opacity: .7; transform: scale(.5); }
  75%, 100% { opacity: 0; transform: scale(1.05); }
}
@keyframes mau-step {
  0%, 19% {
    border-color: #f1b8dd;
    background: #fffafd;
    box-shadow: 0 10px 22px rgba(204, 0, 144, .16);
  }
  27%, 100% {
    border-color: var(--mau-line);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 8px 18px rgba(13, 22, 40, .055);
  }
}
@keyframes mau-step-badge {
  0%, 19% { background: var(--mau-brand); color: #fff; }
  27%, 100% { background: #eef2f8; color: var(--mau-ink); }
}

@media (max-width: 560px) {
  .mau-flow-animation { min-height: 430px; }
  .mau-node { min-width: 112px; gap: 6px; padding: 8px; font-size: .62rem; }
  .mau-node b { width: 22px; height: 22px; }
  .mau-node small { font-size: .55rem; }
  .mau-node--track, .mau-node--engage { left: 8px; }
  .mau-node--profile, .mau-node--segment { right: 8px; }
  .mau-core { transform: translateX(-50%) scale(.8); }
  .mau-foot { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .mau-flow-animation *,
  .mau-flow-animation *::before,
  .mau-flow-animation *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
