/* MIDPL Group guided chatbot - shared by all divisions.
   Pages can move the launcher with: :root { --mchat-bottom: 24px; --mchat-bottom-mobile: 70px; } */
.mchat-launcher, .mchat-teaser, .mchat-box, .mchat-box * { box-sizing: border-box; }
.mchat-launcher, .mchat-teaser, .mchat-box { font-family: "Poppins", "Outfit", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.mchat-box button, .mchat-box input { font-family: inherit; }
.mchat-launcher svg, .mchat-box svg { width: 1em; height: 1em; display: block; }

.mchat-launcher {
  position: fixed;
  right: 25px;
  bottom: var(--mchat-bottom, 24px);
  z-index: 990;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #FF4A17;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 74, 23, 0.4);
  transition: transform 0.25s ease;
}
.mchat-launcher:hover { transform: scale(1.07); }
.mchat-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #25D366;
  border: 2px solid #181818;
}
/* While the chat is open, hide the floating buttons it would cover. */
.mchat-lock .mchat-launcher, .mchat-lock .mchat-teaser, .mchat-lock .midpl-whatsapp, .mchat-lock .cs-scrollup { opacity: 0; visibility: hidden; }

.mchat-teaser {
  position: fixed;
  right: 95px;
  bottom: calc(var(--mchat-bottom, 24px) + 8px);
  z-index: 990;
  max-width: 240px;
  padding: 12px 16px;
  border-radius: 14px 14px 4px 14px;
  background: #fff;
  color: #222;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.3s ease;
}
.mchat-teaser.show { opacity: 1; visibility: visible; transform: none; }

.mchat-box {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 1100; /* above sticky site headers */
  width: 370px;
  height: min(600px, calc(100vh - 50px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.98);
  transform-origin: bottom right;
  transition: all 0.25s ease;
  text-align: left;
}
.mchat-box.open { opacity: 1; visibility: visible; transform: none; }
.mchat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mchat-avatar { width: 40px; height: 40px; padding: 7px; border-radius: 50%; background: #222; }
.mchat-title { color: #fff; font-weight: 600; font-size: 16px; line-height: 1.3; }
.mchat-sub { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.mchat-online { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #25D366; margin-right: 6px; }
.mchat-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.mchat-close:hover { opacity: 1; }
.mchat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.mchat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}
.mchat-msg.bot { align-self: flex-start; background: #2a2a2a; color: #eee; border-bottom-left-radius: 4px; }
.mchat-msg.user { align-self: flex-end; background: #FF4A17; color: #fff; border-bottom-right-radius: 4px; }
.mchat-msg strong { color: #fff; }
.mchat-msg.typing { display: flex; gap: 4px; padding: 14px; }
.mchat-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: #888; animation: mchat-blink 1s infinite ease-in-out; }
.mchat-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.mchat-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mchat-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
.mchat-summary { margin-top: 8px; font-size: 13px; }
.mchat-summary div { padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.mchat-summary span { display: inline-block; width: 86px; color: rgba(255, 255, 255, 0.5); }
.mchat-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mchat-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
.mchat-actions a:hover { color: #fff; opacity: 0.9; }
.mchat-actions svg { font-size: 15px; }
.mchat-actions .wa { background: #25D366; }
.mchat-actions .call { background: #FF4A17; }
.mchat-opts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; max-height: 45%; overflow-y: auto; }
.mchat-opts:empty { display: none; }
.mchat-chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 74, 23, 0.7);
  background: transparent;
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mchat-chip:hover, .mchat-chip.primary { background: #FF4A17; border-color: #FF4A17; }
.mchat-input { display: none; gap: 8px; padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); background: #111; margin: 0; }
.mchat-input input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #1f1f1f;
  color: #fff;
  font-size: 15px;
  outline: none;
}
.mchat-input input:focus { border-color: #FF4A17; }
.mchat-input input.bad { border-color: #ff4d4d; animation: mchat-shake 0.3s; }
@keyframes mchat-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.mchat-input button {
  width: 42px;
  height: 42px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #FF4A17;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
@media (max-width: 767px) {
  .mchat-launcher { right: 15px; bottom: var(--mchat-bottom-mobile, 70px); width: 54px; height: 54px; font-size: 24px; }
  .mchat-teaser { right: 80px; bottom: calc(var(--mchat-bottom-mobile, 70px) + 6px); }
  .mchat-box { right: 0; bottom: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .mchat-lock, .mchat-lock body { overflow: hidden; }
  .mchat-msg { font-size: 15px; }
}
