/* Alma WA Connect — pulsante WhatsApp del sito.
   Tutto sotto #alma-wa, con valori espliciti: il tema del sito non deve cambiarne l'aspetto. */

#alma-wa {
  --alma-wa-green: #25d366;
  --alma-wa-deep: #008069;
  --alma-wa-deep-hover: #006b58;
  --alma-wa-ink: #111b21;
  --alma-wa-muted: #54656f;
  --alma-wa-line: #d1d7db;
  --alma-wa-paper: #efeae2;
  position: fixed;
  bottom: 20px;
  z-index: 99990;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: var(--alma-wa-ink);
  text-align: left;
}
#alma-wa.alma-wa--right { right: 20px; }
#alma-wa.alma-wa--left { left: 20px; }

#alma-wa *,
#alma-wa *::before,
#alma-wa *::after { box-sizing: border-box; }

#alma-wa [hidden] { display: none !important; }

/* ── Pulsante ─────────────────────────────────────────────────────────── */
#alma-wa .alma-wa__launcher {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--alma-wa-green);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  cursor: pointer;
  transition: transform .15s ease;
}
#alma-wa.alma-wa--right .alma-wa__launcher { margin-left: auto; }
#alma-wa .alma-wa__launcher:hover { transform: scale(1.06); }
#alma-wa .alma-wa__launcher:focus-visible,
#alma-wa .alma-wa__close:focus-visible,
#alma-wa .alma-wa__send:focus-visible {
  outline: 3px solid var(--alma-wa-ink);
  outline-offset: 3px;
}

/* ── Riquadro ─────────────────────────────────────────────────────────── */
#alma-wa .alma-wa__panel {
  width: 340px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 110px);
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .22);
}

#alma-wa .alma-wa__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px 14px 16px;
  background: var(--alma-wa-deep);
  color: #fff;
}
#alma-wa .alma-wa__title,
#alma-wa .alma-wa__sub { margin: 0; padding: 0; color: #fff; }
#alma-wa .alma-wa__title { font-size: 16px; font-weight: 600; }
#alma-wa .alma-wa__sub { font-size: 13px; opacity: .9; }
#alma-wa .alma-wa__close {
  flex: none;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
#alma-wa .alma-wa__close:hover { background: rgba(255, 255, 255, .16); }
#alma-wa .alma-wa__close:focus-visible { outline-color: #fff; outline-offset: 0; }

#alma-wa .alma-wa__body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  background: var(--alma-wa-paper);
}

#alma-wa .alma-wa__bubble {
  position: relative;
  display: inline-block;
  max-width: 92%;
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 0 10px 10px 10px;
  background: #fff;
  color: var(--alma-wa-ink);
  font-size: 14.5px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}

/* ── Modulo ───────────────────────────────────────────────────────────── */
#alma-wa .alma-wa__form {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
}
#alma-wa .alma-wa__label {
  display: block;
  margin: 0 0 4px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--alma-wa-ink);
}
#alma-wa .alma-wa__field {
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--alma-wa-line);
  border-radius: 8px;
  background: #fff;
  color: var(--alma-wa-ink);
  font: inherit;
  /* sotto i 16px iOS ingrandisce la pagina quando si tocca il campo */
  font-size: 16px;
  box-shadow: none;
}
#alma-wa textarea.alma-wa__field { height: auto; resize: vertical; }
#alma-wa .alma-wa__field:focus {
  outline: 2px solid var(--alma-wa-deep);
  outline-offset: 0;
  border-color: var(--alma-wa-deep);
}

#alma-wa .alma-wa__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#alma-wa .alma-wa__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 2px 0 12px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--alma-wa-muted);
  cursor: pointer;
}
#alma-wa .alma-wa__consent input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--alma-wa-deep);
}
#alma-wa .alma-wa__consent a { color: var(--alma-wa-deep); text-decoration: underline; }

#alma-wa .alma-wa__error {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fdecea;
  color: #8a1c13;
  font-size: 13px;
}

#alma-wa .alma-wa__send {
  display: block;
  width: 100%;
  margin: 0;
  padding: 11px 14px;
  border: 0;
  border-radius: 99px;
  background: var(--alma-wa-deep);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
#alma-wa .alma-wa__send:hover { background: var(--alma-wa-deep-hover); color: #fff; }

@media (max-width: 480px) {
  #alma-wa { bottom: 12px; }
  #alma-wa.alma-wa--right { right: 12px; }
  #alma-wa.alma-wa--left { left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  #alma-wa .alma-wa__launcher { transition: none; }
  #alma-wa .alma-wa__launcher:hover { transform: none; }
}
