/* consulenza-meta-ads: componenti propri della pagina marketing/consulenza-meta-ads.html, prefisso "cma-".
   Il filo della pagina è il percorso di un annuncio dentro Meta: creatività e segnali entrano, passano da recupero,
   ranking e asta, escono come annuncio nel feed. La hero lo disegna, le cinque leve lo seguono nello stesso ordine.
   Base: token e componenti di site.css. Movimento solo con prefers-reduced-motion: no-preference; senza movimento,
   senza JavaScript e in stampa ogni disegno è completo e fermo nello stato finale. «Ferma le animazioni» del sito
   (html.motion-paused) mette in pausa tutto con la regola generale di site.css. */

/* ---------- HERO ---------- */
.cma-hero .h1 { font-size: clamp(2.1rem, 3.8vw, 3.2rem); }
.cma-hero .lead { max-width: 600px; }
@media (min-width: 901px) { .cma-hero .hero-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; } }

/* scena: creatività e segnali → sistema di Meta → annuncio consegnato */
.cma-art { margin: 0; display: grid; place-items: center; }
.cma-art svg { width: 100%; max-width: 560px; height: auto; overflow: visible; }
.cma-art .lab { font: 600 12.5px/1 var(--sans); fill: var(--dark-muted); }
.cma-art .t { font: 600 12.5px/1 var(--sans); fill: #e2e8f0; }
.cma-art .tt { font: 800 13.5px/1 var(--sans); fill: #fff; }
.cma-art .ts { font: 600 9.5px/1 var(--sans); fill: var(--dark-muted); }
.cma-art .tb { font: 700 10px/1 var(--sans); fill: #fff; }
.cma-art .box { fill: rgba(255, 255, 255, .05); stroke: rgba(148, 163, 184, .28); stroke-width: 1.2; }
.cma-art .thumb { fill: color-mix(in srgb, var(--a-hi) 22%, transparent); }
.cma-art .ink { fill: none; stroke: var(--a-hi); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cma-art .chip { fill: color-mix(in srgb, var(--a) 20%, transparent); stroke: color-mix(in srgb, var(--a-hi) 55%, transparent); stroke-width: 1.2; }
.cma-art .dot { fill: var(--a-hi); }
.cma-art .wire { fill: none; stroke: rgba(148, 163, 184, .3); stroke-width: 1.5; }
.cma-art .flow { fill: none; stroke: var(--a-hi); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 3 11; opacity: .75; }
.cma-art .tier { fill: color-mix(in srgb, var(--a) 30%, transparent); stroke: color-mix(in srgb, var(--a-hi) 60%, transparent); stroke-width: 1.2; }
.cma-art .phone { fill: rgba(255, 255, 255, .04); stroke: rgba(226, 232, 240, .55); stroke-width: 1.6; }
.cma-art .post { fill: rgba(255, 255, 255, .08); }
.cma-art .ad { fill: rgba(6, 10, 19, .6); stroke: var(--a-hi); stroke-width: 1.6; }
.cma-art .ad-img { fill: color-mix(in srgb, var(--a) 45%, transparent); }
.cma-art .cta { fill: var(--a); }
.cma-art .ok { fill: #16a34a; }
.cma-art .okv { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* elementi che esistono solo in movimento (le particelle sui fili): fermi restano invisibili */
.cma-art .fx { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .cma-art .flow { animation: cma-scorri 1.4s linear infinite; }
  .cma-art .tier { animation: cma-accendi 7s ease-in-out infinite both; }
  .cma-art .tier.r2 { animation-delay: 2.5s; }
  .cma-art .tier.r3 { animation-delay: 3.2s; }
  .cma-art .tier.r1 { animation-delay: 1.7s; }
  .cma-art .crea { animation: cma-parti 7s ease-in-out infinite both; }
  .cma-art .crea.c2 { animation-delay: .2s; }
  .cma-art .crea.c3 { animation-delay: .4s; }
  .cma-art .crea.c4 { animation-delay: 1s; }
  .cma-art .crea.c5 { animation-delay: 1.2s; }
  .cma-art .scroll { animation: cma-feed 7s cubic-bezier(.16, 1, .3, 1) infinite both; }
  .cma-art .badge { transform-box: fill-box; transform-origin: center; animation: cma-consegna 7s ease-out infinite both; }

  /* particelle lungo i fili: solo dove il browser sa muovere un elemento su un tracciato */
  @supports (offset-path: path("M0 0")) {
    .cma-art .q { opacity: 1; offset-rotate: 0deg; animation: cma-viaggio 7s ease-in-out infinite both; }
    .cma-art .q1 { offset-path: path("M156 62 C186 62 182 136 206 136"); }
    .cma-art .q2 { offset-path: path("M156 116 C184 116 184 136 206 136"); animation-delay: .2s; }
    .cma-art .q3 { offset-path: path("M156 170 C184 170 184 136 206 136"); animation-delay: .4s; }
    .cma-art .q4 { offset-path: path("M156 259 C192 259 190 200 218 200"); animation-delay: 1s; }
    .cma-art .q5 { offset-path: path("M156 303 C196 303 192 200 218 200"); animation-delay: 1.2s; }
    .cma-art .q6 { offset-path: path("M312 264 C342 264 338 212 366 212"); animation-delay: 3.5s; }
  }
}
@keyframes cma-scorri { to { stroke-dashoffset: -28; } }
@keyframes cma-viaggio {
  0% { offset-distance: 0%; opacity: 0; }
  4% { opacity: 1; }
  26% { offset-distance: 100%; opacity: 1; }
  30%, 100% { offset-distance: 100%; opacity: 0; }
}
@keyframes cma-parti {
  0%, 22%, 100% { stroke: rgba(148, 163, 184, .28); }
  6% { stroke: var(--a-hi); }
}
@keyframes cma-accendi {
  0%, 24%, 100% { fill: color-mix(in srgb, var(--a) 30%, transparent); }
  8% { fill: color-mix(in srgb, var(--a) 80%, transparent); }
}
@keyframes cma-feed {
  0% { transform: translateY(96px); opacity: 0; }
  8%, 50% { transform: translateY(96px); opacity: 1; }
  68%, 92% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(0); opacity: 0; }
}
@keyframes cma-consegna {
  0%, 70% { transform: scale(0); opacity: 0; }
  76% { transform: scale(1.18); opacity: 1; }
  80%, 92% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* ---------- IL PROBLEMA: scheda di diagnosi ---------- */
.cma-diagnosi { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cma-sintomo {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 2fr); gap: 8px 40px;
  padding: 26px 28px; border-radius: var(--r-lg); background: var(--bg-2);
}
.cma-sintomo:nth-child(even) { background: var(--bg-3); }
.cma-sintomo h3 { font-size: 1.2rem; margin: 0 0 6px; }
.cma-sintomo .cma-vedi { margin: 0; font-size: 1.05rem; color: var(--ink-2); font-weight: 600; line-height: 1.45; }
.cma-sintomo dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 32px; }
.cma-sintomo dt { grid-row: 1; font-size: 13.5px; font-weight: 700; color: var(--a-strong); }
.cma-sintomo dd { grid-row: 2; margin: 0; font-size: 15.5px; color: var(--body); }
.cma-esempio { margin-top: 28px; }
.cma-esempio p { margin: 0 0 .6em; }
@media (max-width: 860px) {
  .cma-sintomo { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
  .cma-sintomo dl { grid-template-columns: minmax(0, 1fr); }
  .cma-sintomo dt, .cma-sintomo dd { grid-row: auto; }
  .cma-sintomo dd + dt { margin-top: 10px; }
}

/* ---------- LE CINQUE LEVE: binario nell'ordine del percorso dell'annuncio ---------- */
.cma-rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; position: relative; }
.cma-rail::before {
  content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px;
  background: color-mix(in srgb, var(--a) 35%, var(--line));
}
.cma-tappa { position: relative; padding-top: 34px; }
.cma-tappa::before {
  content: ""; position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-2); border: 3px solid var(--a);
}
.cma-tappa .cma-dove { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--a-strong); }
.cma-tappa h3 { font-size: 1.15rem; margin: 0 0 10px; }
.cma-tappa p { font-size: 15.5px; color: var(--body); }
.cma-tappa .cma-ricevi { margin: 0 0 10px; padding: 12px 14px; border-radius: var(--r-sm); background: #fff; color: var(--ink-2); font-size: 14.5px; }
.cma-tappa .cma-link { margin: 0; font-size: 14.5px; }
/* impulso che corre sul binario: solo in movimento */
.cma-rail::after { content: none; }
@media (prefers-reduced-motion: no-preference) {
  .cma-rail::after {
    content: ""; position: absolute; top: 4px; left: 0; width: 8px; height: 8px; border-radius: 50%;
    background: var(--a); box-shadow: 0 0 0 4px var(--a-ring);
    animation: cma-binario 6s cubic-bezier(.45, 0, .55, 1) infinite;
  }
}
@keyframes cma-binario { 0% { left: 0; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: 0; } }
@media (max-width: 1080px) {
  .cma-rail { grid-template-columns: minmax(0, 1fr); gap: 0; padding-left: 34px; }
  .cma-rail::before { left: 7px; right: auto; top: 8px; bottom: 8px; width: 2px; height: auto; }
  .cma-rail::after { display: none; }
  .cma-tappa { padding: 0 0 30px; max-width: 720px; }
  .cma-tappa:last-child { padding-bottom: 0; }
  .cma-tappa::before { left: -34px; top: 4px; }
}

/* ---------- CONDIZIONI: audit o gestione, compenso, account ---------- */
.cma-formule { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cma-formula { padding: clamp(24px, 3vw, 34px); border-radius: var(--r-lg); background: rgba(255, 255, 255, .05); }
.cma-formula h3 { font-size: 1.35rem; margin: 0 0 10px; }
.cma-formula p { color: var(--dark-text); }
.cma-formula .cma-ricevi { margin: 0; color: #e2e8f0; }
.cma-patti { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 48px; margin-top: 44px; }
.cma-patto h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.25; margin: 0 0 12px; }
.cma-patto p { color: var(--dark-text); }
.cma-patto .cma-fonti { font-size: 14px; color: var(--dark-muted); margin: 0; }
.cma-patto .cma-fonti a, .cma-condizioni .cma-nota a { color: var(--a-hi); }
.cma-condizioni .cma-nota { margin: 22px 0 0; color: #e2e8f0; }
@media (max-width: 800px) {
  .cma-formule, .cma-patti { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- FASI: chi fa cosa ---------- */
.cma-fasi .table { min-width: 0; }
.cma-fasi .table th[scope="row"] { color: var(--ink); font-weight: 700; white-space: nowrap; }
.cma-fasi .table td { color: var(--body); }
.cma-fasi .table thead th:nth-child(2), .cma-fasi .table thead th:nth-child(3) { width: 42%; }
@media (max-width: 720px) {
  .cma-fasi .table-wrap { overflow: visible; border: 0; background: transparent; }
  .cma-fasi .table, .cma-fasi .table tbody, .cma-fasi .table tr, .cma-fasi .table th, .cma-fasi .table td { display: block; width: auto; }
  .cma-fasi .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cma-fasi .table tr { margin: 0 0 12px; padding: 16px 18px; border-radius: var(--r); background: var(--bg-2); }
  /* in schede niente colonna fissa: la regola delle tabelle dei servizi di site.css (sticky e ombra) qui non serve */
  .cma-fasi .table-wrap table :is(th, td):first-child { position: static; box-shadow: none; background: none; }
  .cma-fasi .table th[scope="row"] { padding: 0 0 8px; border: 0; background: none; white-space: normal; font-size: 1.05rem; }
  .cma-fasi .table td { padding: 6px 0 0; border: 0; }
  .cma-fasi .table td::before { content: attr(data-label) ": "; font-weight: 700; color: var(--ink-2); }
}

/* ---------- FAQ: letture e strumenti a fianco ---------- */
.cma-letture h3 { font-size: 1.05rem; margin: 26px 0 10px; }
.cma-letture ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cma-letture li { font-size: 15px; line-height: 1.5; }
.cma-letture li a { font-weight: 600; }
.cma-letture li span { display: block; color: var(--muted); font-size: 14px; }
