/* ==========================================================================
   AC_A11Y_TEMPLATE_V1 (2026-11-25, ampliamento autorizzato dal titolare: difetti B-01..B-12)
   Caricato su TUTTO il sito: corregge componenti comuni (header, footer, modulo preventivo).
   Le regole dei componenti di contenuto del modello filiali stanno in filiali-template-v1.css.
   executed-by: frontend-builder@assicomunale

   Solo token del design system, nessun colore fisso, nessun !important. Contrasti misurati con
   _tools/contrasti.mjs: skip link 15,99:1 · CTA header 4,60:1 (hover 6,04:1) · testo sul pannello
   del modulo 12,92:1 nel caso peggiore · placeholder 6,90:1 · esiti 6,05:1 e 6,71:1 · footer 10,96:1.
   ========================================================================== */

/* --------------------------------------------------------------------------
   B-02: skip link. A focus una regola del tema portava il testo a #222 sul fondo --ac-dark (1,005:1).
   -------------------------------------------------------------------------- */
html body a.ac-skip-link.ac-skip-link:focus,
html body a.ac-skip-link.ac-skip-link:focus-visible {
  color: var(--ac-neutral-0);
  background: var(--ac-dark);
}

/* --------------------------------------------------------------------------
   B-03: pulsante principale dell'header (bianco su accent-500 = 3,53:1).
   reskin-comunale.css 525-542 fissa il fondo con background: var(--c-accent) !important (hover
   var(--c-accent-hover)). Senza !important lo si corregge alla fonte: le due variabili vengono
   ridefinite sul solo contenitore della CTA, cosi' la regola del reskin risolve sui token scuri.
   -------------------------------------------------------------------------- */
html body .ac-header .ac-header__cta {
  --c-accent: var(--ac-accent-600);
  --c-accent-hover: var(--ac-accent-700);
}

/* --------------------------------------------------------------------------
   B-01: menu mobile azionabile da tastiera.
   Senza JavaScript resta il meccanismo di oggi (checkbox + label). Con JavaScript
   (a11y-template-v1.js aggiunge .ac-js-menu all'header) compaiono i pulsanti veri e le label
   si nascondono. Le classi .ac-hamburger e .ac-mobile-sub-label sono condivise, quindi
   l'animazione e gli stati :checked di header.css valgono anche per i pulsanti.
   -------------------------------------------------------------------------- */
html body .ac-header .ac-hamburger--btn,
html body .ac-header .ac-mobile-sub-btn,
html body .ac-header .ac-mobile-nav__close {
  display: none;
}

@media (max-width: 1024px) {
  html body .ac-header.ac-js-menu .ac-hamburger--btn {
    display: flex;
    color: inherit;
    font: inherit;
  }

  html body .ac-header.ac-js-menu label.ac-hamburger,
  html body .ac-header.ac-js-menu label.ac-mobile-sub-label {
    display: none;
  }

  html body .ac-header.ac-js-menu .ac-mobile-sub-btn {
    display: flex;
    width: 100%;
    background: none;
    border: 0;
    font: inherit;
    text-align: left;
  }

  html body .ac-header.ac-js-menu .ac-mobile-nav__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: var(--ac-radius-md);
    color: var(--ac-dark);
    cursor: pointer;
  }

  html body .ac-header .ac-mobile-nav__close svg {
    width: 22px;
    height: 22px;
  }

  html body .ac-header .ac-hamburger--btn:focus-visible,
  html body .ac-header .ac-mobile-sub-btn:focus-visible,
  html body .ac-header .ac-mobile-nav__close:focus-visible,
  html body .ac-header .ac-mobile-nav a:focus-visible {
    outline: 3px solid var(--ac-primary-500);
    outline-offset: -3px;
  }
}

/* --------------------------------------------------------------------------
   B-06, B-07, B-08: modulo preventivo.
   Il pannello di vetro (rgba bianco 8%) lasciava il testo bianco a 3,58:1 sull'estremo rosa del
   gradiente. Ora e' scuro: tutto cio' che ci sta sopra (etichette, consenso, link privacy) supera
   4,5:1 su tutto il rettangolo. Il primo background e' il ripiego senza color-mix.
   -------------------------------------------------------------------------- */
html body .ac-form-section form.ac-preventivo-form.ac-preventivo-form {
  background: var(--ac-dark);
  background: color-mix(in srgb, var(--ac-dark) 82%, transparent);
  border-color: color-mix(in srgb, var(--ac-neutral-0) 18%, transparent);
}

html body .ac-preventivo-form .ac-input.ac-input::placeholder {
  color: var(--ac-neutral-600);
  opacity: 1;
}

/* Etichette visibili e indicazioni, inserite dal filtro AC_FORM_A11Y_V1 in assicomunale-core.php */
html body .ac-preventivo-form .ac-field-label {
  display: block;
  margin: 0 0 var(--ac-space-1);
  color: var(--ac-neutral-0);
  font-size: var(--ac-text-sm);
  font-weight: var(--ac-weight-semibold);
  line-height: 1.3;
  text-align: left;
}

html body .ac-preventivo-form .ac-field-label__opt {
  font-weight: var(--ac-weight-regular);
}

html body .ac-preventivo-form .ac-field-hint {
  display: block;
  margin-top: var(--ac-space-1);
  color: var(--ac-neutral-0);
  font-size: var(--ac-text-xs);
  line-height: 1.3;
}

html body .ac-preventivo-form p.ac-form-note {
  margin: 0 0 var(--ac-space-4);
  max-width: none;
  color: var(--ac-neutral-0);
  font-size: var(--ac-text-sm);
  text-align: left;
}

/* --------------------------------------------------------------------------
   B-09 e B-10: messaggio di esito. Regione live gia' presente (filtro PHP), focus spostato dal
   JavaScript, fondi scuriti nella stessa famiglia di colore (esito positivo 6,05:1, errore 6,71:1).
   La regola inline del gestore (core, wp_footer) pesa 0,1,0: queste pesano 0,2,2.
   -------------------------------------------------------------------------- */
html body .ac-form-message.ac-form-message--success {
  background: var(--ac-success-500);
  background: color-mix(in srgb, var(--ac-success-500) 70%, var(--ac-neutral-900));
  border-color: transparent;
  color: var(--ac-neutral-0);
}

html body .ac-form-message.ac-form-message--error {
  background: var(--ac-error-500);
  background: color-mix(in srgb, var(--ac-error-500) 70%, var(--ac-neutral-900));
  border-color: transparent;
  color: var(--ac-neutral-0);
}

html body .ac-form-message:focus {
  outline: 2px solid var(--ac-neutral-0);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   B-12: etichette dei contatti nel footer (bianco al 40% su --ac-dark = 3,66:1).
   -------------------------------------------------------------------------- */
html body .ac-footer .ac-footer__contact-label {
  color: var(--ac-neutral-300);
}
