/* SqueezeMind Chat: widget di navigazione (.smc) e blocco automazioni (.aut).
   Autonomo: usa i token del sito se ci sono, altrimenti i valori di ripiego (tema WordPress). */
.smc, .aut {
  --smc-ink: var(--c-ink-900, #2e2d2c);
  --smc-lime: var(--c-lime-500, #aff912);
  --smc-lime-50: var(--c-lime-50, #f3fdd9);
  --smc-muted: var(--c-ink-500, #69696a);
  --smc-rule: rgba(46, 45, 44, 0.16);
  --smc-font: var(--f-display, "Montserrat", system-ui, sans-serif);
  --smc-body: var(--f-body, "Raleway", system-ui, sans-serif);
}

/* ---------------- lanciatore e pannello */
.smc { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem; font-family: var(--smc-body); }
.smc-launch {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 52px; padding: 0.45rem 1.15rem 0.45rem 0.55rem;
  border: 0; border-radius: 999px; background: var(--smc-ink); color: #fff; cursor: pointer;
  font: 700 0.9rem var(--smc-font); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); transition: transform 0.2s ease;
}
.smc-launch:hover { transform: translateY(-2px); }
.smc-launch:focus-visible, .smc button:focus-visible, .smc textarea:focus-visible, .smc a:focus-visible { outline: 3px solid var(--smc-lime); outline-offset: 2px; }
/* icona "robot" delle pagine AI, generata dal build (assets/img/chat-robot.svg) */
.smc-ico { width: 42px; height: 42px; border-radius: 50%; background: var(--smc-lime); flex: none; display: grid; place-items: center; }
.smc-ico img, .smc-head__ico img { display: block; width: 30px; height: auto; image-rendering: pixelated; }
.smc-head__ico { width: 40px; height: 40px; border-radius: 50%; background: var(--smc-lime); flex: none; display: grid; place-items: center; }
.smc.is-open .smc-launch__t { display: none; }
.smc.is-open .smc-launch { padding-right: 0.55rem; }

.smc-panel {
  width: min(380px, calc(100vw - 2.5rem)); max-height: min(620px, calc(100vh - 7rem)); display: flex; flex-direction: column;
  background: #fff; color: var(--smc-ink); border: 1.5px solid var(--smc-ink); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.smc-panel[hidden] { display: none; }
.smc-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; background: var(--smc-ink); color: #fff; }
.smc-head__t { flex: 1; min-width: 0; }
.smc-head__n { font: 800 1rem var(--smc-font); margin: 0; }
.smc-head__s { font-size: 0.8rem; opacity: 0.75; margin: 0.15rem 0 0; }
.smc-x { position: relative; width: 36px; height: 36px; border: 0; background: none; cursor: pointer; flex: none; }
.smc-x::before, .smc-x::after { content: ""; position: absolute; left: 9px; top: 17px; width: 18px; height: 2px; background: #fff; transform: rotate(45deg); }
.smc-x::after { transform: rotate(-45deg); }
.smc-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; min-height: 160px; overscroll-behavior: contain; }
.smc-msg { max-width: 88%; padding: 0.65rem 0.85rem; font-size: 0.925rem; line-height: 1.45; }
.smc-msg p { margin: 0; white-space: pre-line; }
.smc-msg--a { align-self: flex-start; background: #f4f4f3; }
.smc-msg--u { align-self: flex-end; background: var(--smc-ink); color: #fff; }
.smc-links { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.smc-links a { display: inline-flex; align-items: center; min-height: 34px; padding: 0.3rem 0.8rem; border-radius: 999px; background: var(--smc-lime); color: var(--smc-ink); font: 700 0.8rem var(--smc-font); text-decoration: none; }
.smc-links a:hover { background: var(--smc-ink); color: var(--smc-lime); }
.smc-typing { display: inline-flex; gap: 4px; }
.smc-typing span { width: 6px; height: 6px; background: var(--smc-muted); animation: smcDot 1s infinite ease-in-out; }
.smc-typing span:nth-child(2) { animation-delay: 0.15s; } .smc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes smcDot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.smc-sugg { display: flex; gap: 0.4rem; padding: 0.6rem 1rem; overflow-x: auto; scrollbar-width: thin; border-top: 1px solid var(--smc-rule); }
.smc-sugg:empty { display: none; }
.smc-sugg button { flex: none; white-space: nowrap; min-height: 34px; padding: 0.3rem 0.8rem; border: 1.5px solid var(--smc-ink); border-radius: 999px; background: #fff; color: var(--smc-ink); font: 600 0.8rem var(--smc-font); cursor: pointer; }
.smc-sugg button:hover { background: var(--smc-lime-50); }
.smc-form { padding: 0.25rem 1rem 0.5rem; }
.smc-form textarea { width: 100%; resize: none; border: 1.5px solid var(--smc-muted); padding: 0.55rem 0.7rem; font: 400 0.95rem/1.4 var(--smc-body); color: var(--smc-ink); background: #fff; border-radius: 0; }
.smc-form__bar { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }
.smc-cnt { font-size: 0.75rem; color: var(--smc-muted); }
.smc-send { min-height: 40px; padding: 0.4rem 1.2rem; border: 0; border-radius: 999px; background: var(--smc-lime); color: var(--smc-ink); font: 800 0.875rem var(--smc-font); cursor: pointer; }
.smc-send:disabled, .smc-form textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.smc-note { margin: 0; padding: 0 1rem 0.8rem; font-size: 0.72rem; color: var(--smc-muted); }
@media (max-width: 600px) {
  .smc { right: 0.75rem; bottom: 0.75rem; gap: 0.5rem; }
  .smc-launch__t { display: none; }
  .smc-launch { padding-right: 0.55rem; min-height: 48px; }
  .smc-ico { width: 38px; height: 38px; }
  .smc.is-open { left: 0.75rem; }
  /* sotto l'header (circa 80 px) e sopra il pulsante: l'header resta sempre visibile */
  .smc-panel { width: 100%; max-height: calc(100vh - 11rem); max-height: calc(100dvh - 11rem); }
  .smc-head { padding: 0.6rem 0.8rem; }
  .smc-head__ico { width: 34px; height: 34px; }
  .smc-head__ico img { width: 24px; }
  .smc-head__s { display: none; }
  .smc-log { min-height: 0; padding: 0.75rem; }
  .smc-msg { font-size: 0.9rem; }
  .smc-form textarea { font-size: 16px; } /* niente zoom automatico su iOS */
  .smc-note { font-size: 0.68rem; }
}
@media print { .smc { display: none; } }
@media (prefers-reduced-motion: reduce) { .smc-launch, .smc-typing span { transition: none; animation: none; } }

/* ---------------- blocco automazioni (sezione su band scura del sito) */
.aut { max-width: 60rem; color: inherit; }
.aut-lab, .aut-fld label { display: block; font: 700 0.975rem var(--smc-body); margin-bottom: 0.5rem; }
.aut-fld label span { font-weight: 400; opacity: 0.7; }
.aut textarea, .aut input[type="text"], .aut input[type="email"], .aut input[type="tel"] {
  width: 100%; padding: 0.8rem 1rem; border: 1.5px solid currentColor; background: transparent; color: inherit;
  font: 400 1.02rem/1.5 var(--smc-body); border-radius: 0;
}
.aut textarea:focus-visible, .aut input:focus-visible, .aut button:focus-visible, .aut a:focus-visible { outline: 3px solid var(--smc-lime); outline-offset: 2px; }
.aut-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; }
.aut-cnt { font-size: 0.8rem; opacity: 0.7; }
.aut-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0.6rem 1.4rem; border: 0; border-radius: 999px; font: 800 0.95rem var(--smc-font); cursor: pointer; }
.aut-btn--main { background: var(--smc-lime); color: var(--smc-ink); }
.aut-btn:disabled { opacity: 0.55; cursor: progress; }
.aut-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 1rem; font-size: 0.85rem; }
.aut-ex span { opacity: 0.75; margin-right: 0.25rem; }
.aut-ex button { min-height: 36px; padding: 0.35rem 0.9rem; border: 1.5px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: 600 0.8rem var(--smc-font); cursor: pointer; text-align: left; }
.aut-ex button:hover { border-color: var(--smc-lime); color: var(--smc-lime); }
.aut-stato:not(:empty) { margin-top: 0.9rem; font-weight: 600; }
.aut.is-busy .aut-stato::after { content: ""; display: inline-block; width: 0.6em; height: 0.6em; margin-left: 0.5em; background: var(--smc-lime); animation: smcDot 1s infinite; }
.aut-out:not(:empty) { margin-top: 1.75rem; }
.aut-out, .aut-lead { scroll-margin-top: 110px; } /* sotto l'header fisso quando si scorre da soli */
.aut-sint { font: 600 1.1rem/1.45 var(--smc-font); margin: 0 0 1.25rem; }
.aut-h { font: 800 0.8rem var(--smc-body); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; margin: 0 0 0.75rem; }
.aut-sol { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.aut-sol li { display: grid; align-content: start; border: 1.5px solid currentColor; }
.aut-card { display: flex; gap: 0.75rem; padding: 1rem 1.1rem 0.6rem; cursor: pointer; }
.aut-card input { width: 20px; height: 20px; margin-top: 0.15rem; flex: none; accent-color: var(--smc-lime); }
.aut-card__w { display: grid; gap: 0.35rem; }
.aut-card__t { font: 800 1.02rem/1.3 var(--smc-font); }
.aut-card__d { font-size: 0.93rem; line-height: 1.5; opacity: 0.9; }
.aut-card__b { font-size: 0.86rem; font-weight: 700; color: var(--smc-lime); }
.aut-sol li:has(input:checked) { border-color: var(--smc-lime); box-shadow: inset 0 0 0 1px var(--smc-lime); }
.aut-card__l { margin: 0 1.1rem 0.9rem 3rem; font-size: 0.82rem; font-weight: 700; color: inherit; text-decoration: underline; text-decoration-color: var(--smc-lime); text-underline-offset: 0.25em; }
.aut-dom { font-style: italic; margin: 0 0 1.25rem; }
/* domande prima delle soluzioni (max 2) e filo della conversazione */
.aut-filo { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.5rem; }
.aut-filo li { display: grid; gap: 0.15rem; max-width: 80%; padding: 0.6rem 0.9rem; font-size: 0.93rem; line-height: 1.45; }
.aut-filo__u { justify-self: end; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.25); }
.aut-filo__a { justify-self: start; border-left: 3px solid var(--smc-lime); }
.aut-filo__k { font: 700 0.7rem var(--smc-body); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.65; }
.aut-ask { padding: 1.25rem 1.35rem; border: 1.5px solid var(--smc-lime); }
.aut-ask__n { font: 700 0.75rem/1.4 var(--smc-body); letter-spacing: 0.06em; color: var(--smc-lime); margin: 0 0 0.5rem; }
.aut-ask__q { font: 700 clamp(1.1rem, 1rem + 0.4vw, 1.3rem)/1.35 var(--smc-font); margin: 0 0 1rem; }
.aut-ask__op { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.aut-ask__op button { min-height: 42px; padding: 0.4rem 1rem; border: 1.5px solid var(--smc-lime); border-radius: 999px; background: transparent; color: inherit; font: 700 0.88rem var(--smc-font); cursor: pointer; }
.aut-ask__op button:hover { background: var(--smc-lime); color: var(--smc-ink); }
.aut-ask__f { display: flex; gap: 0.6rem; }
.aut-ask__f input { flex: 1; min-width: 0; }
.aut-ask__skip { margin-top: 0.8rem; padding: 0.3rem 0; border: 0; background: none; color: inherit; font: 600 0.82rem var(--smc-body); text-decoration: underline; text-underline-offset: 0.25em; opacity: 0.75; cursor: pointer; }
.aut-ask button:disabled, .aut-ask input:disabled { opacity: 0.5; cursor: progress; }
@media (max-width: 600px) { .aut-ask__f { flex-direction: column; } .aut-filo li { max-width: 92%; } }
.aut-lead { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid currentColor; }
.aut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
.aut-fld { margin-bottom: 1rem; }
.aut-ck { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0.5rem 0; }
.aut-ck input { width: 20px; height: 20px; flex: none; margin-top: 0.15rem; accent-color: var(--smc-lime); }
.aut-ck a { color: inherit; text-decoration: underline; }
.aut-err { color: #ff8a80; font-weight: 600; font-size: 0.9rem; margin: 0.35rem 0 0; }
.aut-err:empty { display: none; }
.aut-trap { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.aut-ok { font: 700 1.1rem/1.45 var(--smc-font); color: var(--smc-lime); margin: 0; }
.aut-nojs a { color: inherit; text-decoration: underline; text-decoration-color: var(--smc-lime); }
@media (max-width: 767px) { .aut-sol, .aut-grid { grid-template-columns: minmax(0, 1fr); } }

/* emoji del titolo del blocco automazioni: saluta ogni pochi secondi */
.aut-emoji { display: inline-block; transform-origin: 50% 80%; animation: autEmoji 3.2s ease-in-out infinite; }
@keyframes autEmoji {
  0%, 62%, 100% { transform: rotate(0) scale(1); }
  68% { transform: rotate(-14deg) scale(1.15); }
  74% { transform: rotate(12deg) scale(1.15); }
  80% { transform: rotate(-8deg) scale(1.08); }
  86% { transform: rotate(4deg) scale(1.03); }
}
@media (prefers-reduced-motion: reduce) { .aut-emoji { animation: none; } }
.blk-automazione_ai .h2 { max-width: 32ch; }
