/* Sectem Live Chat — replaces theme scroll-top; drives GHL / fallback panel. */

/* Hide the old back-to-top control wherever it still appears. */
.scroll-top {
  display: none !important;
}

/* Keep GHL mounted for openWidget(), but never show its own bubble. */
#sectem-ghl-chat-root chat-widget,
body chat-widget {
  --chat-widget-z-index: 100040;
}

/* Light-DOM LeadConnector launchers (versions vary). Do not target
   chat iframes globally — the open panel also uses an iframe. */
.lc_text-widget,
.lc_text-widget--standard,
#lc_text-widget,
.hl-app .lc_text-widget,
[class*="lc_text-widget"]:not(.sectem-live-chat-panel):not(.sectem-live-chat-btn),
.chat-widget-bubble,
[id*="lc_text-widget"] {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}

/* Applied by live-chat.js only to FAB-sized GHL bubbles. */
.sectem-hide-ghl-bubble {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  transform: scale(0) !important;
}

/* Bottom-right launcher (same slot as former .scroll-top). */
.sectem-live-chat-btn {
  position: fixed;
  z-index: 100050;
  bottom: 24px;
  right: 30px;
  height: 52px;
  min-width: 52px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background-image: -webkit-linear-gradient(-190deg, #003cc8, #00d0fc);
  background-image: linear-gradient(170deg, #003cc8, #00d0fc);
  box-shadow: 0 8px 24px rgba(0, 60, 200, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sectem-live-chat-btn:hover,
.sectem-live-chat-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 60, 200, 0.36);
  color: #fff;
  outline: none;
}

.sectem-live-chat-btn__icon {
  display: block;
  flex-shrink: 0;
}

.sectem-live-chat-btn__label {
  line-height: 1;
}

@media screen and (max-width: 767px) {
  .sectem-live-chat-btn {
    bottom: 16px;
    right: 16px;
    height: 48px;
    min-width: 48px;
    padding: 0 14px;
  }

  .sectem-live-chat-btn__label {
    /* Icon-only on small screens keeps the corner clean. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }
}

/* Fallback chat panel when the GHL widget cannot mount. */
.sectem-live-chat-panel {
  position: fixed;
  z-index: 100060;
  right: 30px;
  bottom: 88px;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  color: #0b1f3a;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(11, 31, 58, 0.22);
  overflow: hidden;
  display: none;
}

.sectem-live-chat-panel.is-open {
  display: block;
}

.sectem-live-chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  background-image: linear-gradient(170deg, #003cc8, #00d0fc);
}

.sectem-live-chat-panel__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.sectem-live-chat-panel__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.sectem-live-chat-panel__body {
  padding: 16px;
}

.sectem-live-chat-panel__body p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
  color: #334155;
}

.sectem-live-chat-panel label {
  display: block;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.sectem-live-chat-panel input,
.sectem-live-chat-panel textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  font: inherit;
  color: inherit;
  background: #fff;
}

.sectem-live-chat-panel textarea {
  min-height: 96px;
  resize: vertical;
}

.sectem-live-chat-panel__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.sectem-live-chat-panel__submit {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background-image: linear-gradient(170deg, #003cc8, #00d0fc);
}

.sectem-live-chat-panel__submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.sectem-live-chat-panel__status {
  margin: 10px 0 0;
  font-size: 13px;
  color: #0b1f3a;
}

.sectem-live-chat-panel__status.is-error {
  color: #b42318;
}

.sectem-live-chat-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

@media screen and (max-width: 767px) {
  .sectem-live-chat-panel {
    right: 16px;
    bottom: 76px;
  }
}
