/**
 * Modern floating contact trigger.
 * Keeps the existing modal and configured actions intact.
 */

body .chatWidgetBtn {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 9993;
  display: inline-flex;
  width: auto;
  min-width: 202px;
  height: 68px;
  padding: 8px 17px 8px 9px;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 21px;
  outline: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(112, 218, 211, 0.26), transparent 35%),
    linear-gradient(135deg, #0d5473 0%, #117d87 55%, #149c91 100%);
  color: #ffffff;
  box-shadow:
    0 18px 38px rgba(9, 64, 84, 0.27),
    0 5px 14px rgba(8, 44, 59, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.17);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    min-width 240ms cubic-bezier(0.16, 1, 0.3, 1),
    width 240ms cubic-bezier(0.16, 1, 0.3, 1),
    padding 240ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
  animation: chatWidgetModernEntry 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body .chatWidgetBtn::before {
  position: absolute;
  z-index: -1;
  inset: -5px;
  border: 1px solid rgba(27, 163, 153, 0.16);
  border-radius: 25px;
  opacity: 0;
  content: "";
  transition: opacity 180ms ease, transform 180ms ease;
}

body .chatWidgetBtn:hover {
  border-color: rgba(255, 255, 255, 0.48);
  color: #ffffff;
  box-shadow:
    0 22px 46px rgba(9, 64, 84, 0.32),
    0 7px 18px rgba(8, 44, 59, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

body .chatWidgetBtn:hover::before {
  opacity: 1;
  transform: scale(1.015);
}

body .chatWidgetBtn:active {
  transform: translateY(-1px) scale(0.985);
}

body .chatWidgetBtn:focus-visible {
  outline: 3px solid rgba(232, 102, 22, 0.65);
  outline-offset: 4px;
}

body .chatWidgetBtnIcon {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body .chatWidgetBtnIcon::after {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 5px;
  height: 5px;
  border: 2px solid #128980;
  border-radius: 50%;
  background: #61e2af;
  content: "";
}

body .chatWidgetBtnChatIcon,
body .chatWidgetBtnCloseIcon {
  position: absolute;
  display: grid;
  place-items: center;
  transition: opacity 200ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

body .chatWidgetBtnChatIcon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

body .chatWidgetBtnCloseIcon {
  opacity: 0;
  transform: scale(0.55) rotate(-35deg);
}

body .chatWidgetBtnIcon svg,
body .chatWidgetBtn:hover .chatWidgetBtnIcon svg {
  width: 25px;
  height: 25px;
  fill: none !important;
  color: #ffffff;
  stroke: currentColor;
  transform: none;
}

body .chatWidgetBtnCloseIcon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  stroke-linecap: round;
}

body .chatWidgetBtnCopy {
  display: flex;
  max-width: 116px;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
  opacity: 1;
  transition: max-width 220ms ease, opacity 140ms ease;
}

body .chatWidgetBtnCopy strong {
  margin-bottom: 1px;
  color: #ffffff;
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

body .chatWidgetBtnCopy small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.25;
}

body .chatWidgetBadge {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 10px;
  height: 10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #ef6c1b;
  box-shadow: 0 3px 8px rgba(124, 43, 0, 0.24);
  animation: chatWidgetBadgeModern 500ms cubic-bezier(0.34, 1.56, 0.64, 1) 650ms both;
}

body .chatWidgetBtn.is-open {
  width: 68px;
  min-width: 68px;
  padding: 8px;
  border-radius: 21px;
  background: linear-gradient(145deg, #123f59, #0d2e43);
  transform: none;
}

body .chatWidgetBtn.is-open:hover {
  transform: translateY(-2px);
}

body .chatWidgetBtn.is-open .chatWidgetBtnCopy {
  max-width: 0;
  opacity: 0;
}

body .chatWidgetBtn.is-open .chatWidgetBtnChatIcon {
  opacity: 0;
  transform: scale(0.55) rotate(35deg);
}

body .chatWidgetBtn.is-open .chatWidgetBtnCloseIcon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

body .chatWidgetBtn.is-open .chatWidgetBtnIcon::after,
body .chatWidgetBtn.is-open .chatWidgetBadge {
  opacity: 0;
}

body .chatWidgetModal {
  right: 28px;
  bottom: 110px;
  width: 340px;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  border: 1px solid rgba(21, 83, 111, 0.12);
  border-radius: 24px;
  box-shadow:
    0 28px 70px rgba(7, 40, 57, 0.22),
    0 8px 24px rgba(7, 40, 57, 0.1);
}

@keyframes chatWidgetModernEntry {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chatWidgetBadgeModern {
  from {
    opacity: 0;
    transform: scale(0);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  body .chatWidgetBtn,
  body .chatWidgetBtn.is-open {
    right: 14px;
    bottom: 84px;
    width: 58px;
    min-width: 58px;
    height: 58px;
    padding: 7px;
    border-radius: 18px;
  }

  body .chatWidgetBtn::before {
    border-radius: 22px;
  }

  body .chatWidgetBtnIcon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 13px;
  }

  body .chatWidgetBtnIcon svg,
  body .chatWidgetBtn:hover .chatWidgetBtnIcon svg {
    width: 22px;
    height: 22px;
  }

  body .chatWidgetBtnCopy {
    display: none;
  }

  body .chatWidgetBadge {
    top: 4px;
    right: 4px;
  }

  body .chatWidgetModal {
    right: 14px;
    bottom: 154px;
    width: min(310px, calc(100vw - 28px));
  }
}

@media (prefers-reduced-motion: reduce) {
  body .chatWidgetBtn,
  body .chatWidgetBtn *,
  body .chatWidgetBadge {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

body.a11y-bw .chatWidgetBtn {
  border: 2px solid #000 !important;
  background: #fff !important;
  color: #000 !important;
  box-shadow: none !important;
}

body.a11y-bw .chatWidgetBtnIcon {
  border-color: #000 !important;
  background: #fff !important;
}

body.a11y-bw .chatWidgetBtnIcon svg,
body.a11y-bw .chatWidgetBtnCopy strong,
body.a11y-bw .chatWidgetBtnCopy small {
  color: #000 !important;
}
