/* Pagina /agenti/ e teaser in home. Nessuno stile inline (CSP style-src 'self'). Token da tokens.css. */

.ag-eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--pk-color-lime-spunta);
  color: var(--pk-color-blu-inchiostro);
  font-size: var(--pk-size-small);
  font-weight: 600;
}

.ag-transparency {
  color: #4a4b6b;
  font-size: var(--pk-size-small);
}

/* Hero */

.ag-hero {
  background-image:
    linear-gradient(rgba(31, 95, 168, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 95, 168, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}

.ag-hero-inner {
  display: grid;
  gap: 32px;
  align-items: center;
}

@media (min-width: 900px) {
  .ag-hero-inner {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.ag-hero-visual {
  margin: 0;
}

.ag-net {
  width: 100%;
  height: auto;
}

.ag-flow-line {
  stroke: var(--pk-color-azzurro-kreative);
  stroke-dasharray: 6 10;
  animation: ag-dash 3s linear infinite;
}

@keyframes ag-dash {
  to { stroke-dashoffset: -64; }
}

.ag-core {
  fill: var(--pk-color-corallo-pragma);
}

.ag-pulse {
  fill: none;
  stroke: var(--pk-color-lime-spunta);
  stroke-width: 4;
  transform-box: fill-box;
  transform-origin: center;
  animation: ag-pulse 2.4s ease-out infinite;
}

@keyframes ag-pulse {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(2.6); opacity: 0; }
}

.ag-satellite {
  animation: ag-bob 4s ease-in-out infinite alternate;
}

.ag-satellite circle {
  fill: var(--pk-color-bianco);
  stroke: var(--pk-color-blu-inchiostro);
  stroke-width: 2;
}

@keyframes ag-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

/* Filtri */

.ag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
}

.ag-filter {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 2px solid var(--pk-color-blu-inchiostro);
  border-radius: 999px;
  background: var(--pk-color-bianco);
  color: var(--pk-color-blu-inchiostro);
  font-family: var(--pk-font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.ag-filter[aria-pressed="true"] {
  background: var(--pk-color-blu-inchiostro);
  color: var(--pk-color-crema);
}

.ag-empty {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--pk-color-bianco);
}

/* Rete di nodi (14 schede) */

.ag-nodes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 14px;
  list-style: none;
  border-radius: 22px;
  background-image: radial-gradient(circle, rgba(31, 95, 168, 0.2) 1.5px, transparent 2px);
  background-size: 28px 28px;
}

@media (min-width: 640px) {
  .ag-nodes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .ag-nodes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ag-nodes.is-ready .ag-node {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.ag-nodes.is-ready.is-in .ag-node {
  opacity: 1;
  transform: none;
}

.ag-node:nth-child(2) { transition-delay: 0.04s; }
.ag-node:nth-child(3) { transition-delay: 0.08s; }
.ag-node:nth-child(4) { transition-delay: 0.12s; }
.ag-node:nth-child(5) { transition-delay: 0.16s; }
.ag-node:nth-child(6) { transition-delay: 0.2s; }
.ag-node:nth-child(7) { transition-delay: 0.24s; }
.ag-node:nth-child(8) { transition-delay: 0.28s; }
.ag-node:nth-child(9) { transition-delay: 0.32s; }
.ag-node:nth-child(10) { transition-delay: 0.36s; }
.ag-node:nth-child(11) { transition-delay: 0.4s; }
.ag-node:nth-child(12) { transition-delay: 0.44s; }
.ag-node:nth-child(13) { transition-delay: 0.48s; }
.ag-node:nth-child(14) { transition-delay: 0.52s; }

.ag-node[hidden] {
  display: none;
}

.ag-node-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 14px 10px;
  border: 2px solid var(--pk-color-blu-inchiostro);
  border-radius: 22px;
  background: var(--pk-color-bianco);
  color: var(--pk-color-blu-inchiostro);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ag-node-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px -10px rgba(255, 90, 54, 0.9);
}

.ag-node-btn[aria-expanded="true"] {
  background: var(--pk-color-corallo-pragma);
}

.ag-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--pk-color-crema);
}

@media (min-width: 640px) {
  .ag-avatar {
    width: 84px;
    height: 84px;
  }
}

.ag-node-name {
  font-family: var(--pk-font-title);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.ag-node-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--pk-color-blu-inchiostro);
  border-radius: 50%;
  background: var(--pk-color-lime-spunta);
}

/* Pannello dettagli (region condivisa sotto la rete) */

.ag-panel {
  margin-top: 20px;
  padding: 24px;
  border: 2px solid var(--pk-color-blu-inchiostro);
  border-top: 8px solid var(--pk-color-corallo-pragma);
  border-radius: 22px;
  background: var(--pk-color-bianco);
}

.ag-panel[hidden] {
  display: none;
}

.ag-panel h3 {
  font-size: var(--pk-size-h3);
}

.ag-panel h4 {
  margin: 16px 0 8px;
  font-size: 1rem;
}

.ag-panel-check {
  color: var(--pk-color-conferma);
  font-size: var(--pk-size-small);
  font-weight: 600;
}

.ag-panel-tasks {
  margin: 0 0 16px;
  padding-left: 1.2rem;
}

.ag-panel-tasks li {
  margin-bottom: 6px;
}

.ag-panel-close {
  min-height: 44px;
  margin-top: 16px;
  padding: 0.5rem 1.2rem;
  border: 2px solid var(--pk-color-blu-inchiostro);
  border-radius: 999px;
  background: var(--pk-color-crema);
  color: var(--pk-color-blu-inchiostro);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Come lavoriamo: 4 passi */

.ag-steps {
  position: relative;
  display: grid;
  gap: 18px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.ag-steps::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 21px;
  width: 4px;
  background: var(--pk-color-azzurro-kreative);
  transform-origin: top;
}

.ag-steps.is-ready::before {
  transform: scaleY(0);
  transition: transform 1.2s ease;
}

.ag-steps.is-ready.is-in::before {
  transform: scaleY(1);
}

.ag-step {
  position: relative;
  padding: 0 0 0 64px;
}

.ag-step-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  border: 2px solid var(--pk-color-blu-inchiostro);
  border-radius: 12px;
  background: var(--pk-color-corallo-pragma);
  transition: background 0.3s ease;
}

.ag-step.is-active .ag-step-dot {
  background: var(--pk-color-lime-spunta);
}

.ag-step-count {
  display: none;
  margin: 0 0 4px;
  color: var(--pk-color-corallo-scuro-testo);
  font-weight: 600;
}

.ag-step.is-active .ag-step-count {
  display: block;
}

.ag-step h3 {
  margin-top: 0;
}

.ag-closing {
  margin: 0;
  font-family: var(--pk-font-title);
  font-size: var(--pk-size-h4);
  font-weight: 700;
}

@media (min-width: 768px) {
  .ag-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
  }

  .ag-steps::before {
    top: 21px;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: 4px;
    transform-origin: left;
  }

  .ag-steps.is-ready::before {
    transform: scaleX(0);
  }

  .ag-steps.is-ready.is-in::before {
    transform: scaleX(1);
  }

  .ag-step {
    padding: 64px 0 0;
  }
}

/* Perché sceglierci */

.ag-why {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .ag-why {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ag-why-item {
  padding: 24px;
  border-left: 8px solid var(--pk-color-azzurro-kreative);
  border-radius: 22px;
  background: var(--pk-color-bianco);
}

/* Video */

.ag-video-layout {
  display: grid;
  gap: 28px;
  align-items: center;
}

@media (min-width: 900px) {
  .ag-video-layout {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.ag-video {
  margin: 0;
}

.ag-video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  background: var(--pk-color-bianco);
}

.ag-video figcaption {
  margin-top: 8px;
  font-size: var(--pk-size-small);
}

/* Teaser in home */

.ag-teaser-avatars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.ag-teaser-avatars img {
  width: 88px;
  height: 88px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--pk-color-bianco);
}

.ag-teaser-avatars span {
  font-weight: 600;
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  .ag-teaser-avatars {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Movimento ridotto: nessuna animazione, stati finali visibili (JS li applica) */

@media (prefers-reduced-motion: reduce) {
  .ag-flow-line,
  .ag-pulse,
  .ag-satellite {
    animation: none;
  }
}
