/* ==========================================================================
   AC_TPL_FILIALI_CSS_V1 (2026-11-25, autorizzazione del titolare 25/11)
   Caricato SOLO sulle pagine dei sub-agenti (assicomunale-core.php, ac_tpl_is_subagente_page()).
   Le regole dei componenti comuni (header, footer, modulo) stanno in a11y-template-v1.css, caricato
   su tutto il sito. Qui restano i componenti di contenuto del modello filiali.
   executed-by: frontend-builder@assicomunale

   Contrasti misurati con _tools/contrasti.mjs sui valori dei token (reskin-comunale.css):
     neutral-0 su accent-600 4,60:1 · su accent-700 6,04:1 · su primary-500 8,72:1
     neutral-900 su whatsapp 8,94:1 · neutral-600 su #f8f5ff 7,02:1 · primary-700 su bianco 10,95:1
   Nessun !important: ogni regola batte la precedente per specificita' (html body + elemento).
   ========================================================================== */

:root {
  /* Verde del marchio WhatsApp: gia' usato come eccezione documentata in service.css (ITER5).
     Diventa un token perche' le regole sotto non scrivano colori fissi. */
  --ac-whatsapp-500: #25D366;
}

/* --------------------------------------------------------------------------
   1. Pulsanti "nudi" nel contenuto (task A, "Chiama" a 3,1:1)
   global-color-fix-v14.css PART 6 (body.ac-service-page .entry-content a, 0,2,2) dava al testo
   var(--ac-primary-700) sul fondo var(--ac-accent-500): 3,11:1. Il bianco sullo stesso rosa resta a
   3,53:1, quindi cambia anche il fondo, restando nella scala accent del sistema.
   I contesti con regole proprie restano fuori grazie a :where(:not(...)), che non pesa.
   -------------------------------------------------------------------------- */
html body .entry-content.entry-content a:where(.ac-btn--primary):where(:not(.ac-hero *, .ac-product *, .ac-card *, .ac-cta-card *)) {
  background: var(--ac-accent-600);
  color: var(--ac-neutral-0);
}

html body .entry-content.entry-content a:where(.ac-btn--primary):where(:not(.ac-hero *, .ac-product *, .ac-card *, .ac-cta-card *)):hover,
html body .entry-content.entry-content a:where(.ac-btn--primary):where(:not(.ac-hero *, .ac-product *, .ac-card *, .ac-cta-card *)):focus-visible {
  background: var(--ac-accent-700);
  color: var(--ac-neutral-0);
}

html body .entry-content.entry-content a:where(.ac-btn--outline):where(:not(.ac-hero *, .ac-product *, .ac-cta-card *)):hover,
html body .entry-content.entry-content a:where(.ac-btn--outline):where(:not(.ac-hero *, .ac-product *, .ac-cta-card *)):focus-visible {
  background: var(--ac-primary-500);
  border-color: var(--ac-primary-500);
  color: var(--ac-neutral-0);
}

/* --------------------------------------------------------------------------
   2. B-03: pulsante principale dell'hero (service.css 484, 0,3,1: bianco su accent-500 = 3,53:1)
   -------------------------------------------------------------------------- */
html body.ac-service-page .ac-hero a.ac-btn--primary {
  background: var(--ac-accent-600);
  color: var(--ac-neutral-0);
}

html body.ac-service-page .ac-hero a.ac-btn--primary:hover,
html body.ac-service-page .ac-hero a.ac-btn--primary:focus-visible {
  background: var(--ac-accent-700);
  color: var(--ac-neutral-0);
}

/* --------------------------------------------------------------------------
   3. B-04: pulsanti WhatsApp (service.css 2846 e 3836: bianco su #25D366 = 1,98:1)
   Testo scuro sul verde pieno del marchio, anche a hover e focus. Il gradiente verso #128C7E
   non si tiene: con il testo scuro scenderebbe a 4,13:1 sull'estremo scuro.
   -------------------------------------------------------------------------- */
html body.ac-service-page a.ac-btn--whatsapp.ac-btn--whatsapp {
  background: var(--ac-whatsapp-500);
  color: var(--ac-neutral-900);
}

html body.ac-service-page a.ac-btn--whatsapp.ac-btn--whatsapp:hover,
html body.ac-service-page a.ac-btn--whatsapp.ac-btn--whatsapp:focus-visible {
  background: var(--ac-whatsapp-500);
  color: var(--ac-neutral-900);
}

html body.ac-service-page a.ac-btn--whatsapp.ac-btn--whatsapp:focus-visible {
  outline-color: var(--ac-neutral-900);
}

/* --------------------------------------------------------------------------
   4. B-05: contatore dell'indice (service.css 2930: neutral-500 su #f8f5ff = 4,48:1)
   -------------------------------------------------------------------------- */
html body.ac-service-page .ac-toc .ac-toc__count {
  color: var(--ac-neutral-600);
}

/* --------------------------------------------------------------------------
   5. B-11: link dei percorsi (service.css 4183: a hover e focus testo accent-500 = 3,53:1 e
   outline:none). Il testo resta scuro; il focus torna visibile con un anello del sistema.
   -------------------------------------------------------------------------- */
html body.ac-service-page .ac-service-directions-item__body a:hover,
html body.ac-service-page .ac-service-directions-item__body a:focus-visible {
  color: var(--ac-primary-500);
  text-decoration-color: var(--ac-accent-600);
}

html body.ac-service-page .ac-service-directions-item__body a:focus-visible {
  outline: 2px solid var(--ac-primary-700);
  outline-offset: 2px;
  border-radius: var(--ac-radius-sm);
}

/* --------------------------------------------------------------------------
   6. CRO-10 e CRO-12: riquadro sotto il modulo (percorso dopo l'invio + intermediario e RUI).
   Stesso fondo scuro del pannello del modulo (a11y-template-v1.css), quindi stesso contrasto:
   neutral-0 sul pannello 12,92:1 anche sull'estremo rosa del gradiente.
   -------------------------------------------------------------------------- */
html body .ac-form-section .ac-form-aside {
  max-width: 700px;
  margin: var(--ac-space-4) auto 0;
  padding: var(--ac-space-4) var(--ac-space-6);
  border-radius: var(--ac-radius-md);
  background: var(--ac-dark);
  background: color-mix(in srgb, var(--ac-dark) 82%, transparent);
  text-align: left;
  position: relative;
}

html body .ac-form-section .ac-form-aside p {
  margin: 0;
  max-width: none;
  color: var(--ac-neutral-0);
  font-size: var(--ac-text-sm);
  line-height: var(--ac-leading-relaxed);
}

html body .ac-form-section .ac-form-aside p + p {
  margin-top: var(--ac-space-2);
}

html body .ac-form-section .ac-form-aside a {
  color: var(--ac-neutral-0);
  text-decoration: underline;
  text-underline-offset: 3px;
}

html body .ac-form-section .ac-form-aside a:focus-visible {
  outline: 2px solid var(--ac-neutral-0);
  outline-offset: 2px;
}
