/* ==========================================================================
   Site chat assistant (replaces the GoHighLevel widget).
   Loaded on every English and French page next to site.css; the markup is
   built by assets/chat.js. Every rule is scoped under .lsc so nothing here
   can leak into the page.
   ========================================================================== */

.lsc {
  --lsc-gap: 20px;
  font-family: var(--font-body, "Lato", Helvetica, Arial, sans-serif);
  font-size: 15px;
  line-height: 1.45;
  color: #1b2a36;
}
.lsc *, .lsc *::before, .lsc *::after { box-sizing: border-box; }

/* launcher ---------------------------------------------------------------- */

.lsc-launch {
  position: fixed;
  right: var(--lsc-gap);
  bottom: var(--lsc-gap);
  z-index: 150;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--teal, #1fa4a9);
  color: #fff;
  box-shadow: 0 6px 18px rgba(11, 60, 93, .28);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s ease, transform .2s ease;
}
.lsc-launch:hover { background: var(--teal-dark, #178086); transform: translateY(-2px); }
.lsc-launch:focus-visible { outline: 3px solid var(--navy, #0b3c5d); outline-offset: 3px; }
.lsc-launch svg { width: 26px; height: 26px; fill: currentColor; }
.lsc-launch .lsc-ico-close { display: none; }
.lsc.is-open .lsc-launch .lsc-ico-chat { display: none; }
.lsc.is-open .lsc-launch .lsc-ico-close { display: block; }

/* panel ------------------------------------------------------------------- */

.lsc-panel {
  position: fixed;
  right: var(--lsc-gap);
  bottom: calc(var(--lsc-gap) + 70px);
  z-index: 150;
  width: 370px;
  height: min(580px, calc(100vh - 120px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 12px 40px rgba(11, 60, 93, .28);
}
.lsc.is-open .lsc-panel { display: flex; }

.lsc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  background: var(--navy, #0b3c5d);
  color: #fff;
}
.lsc-head img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #fff; flex: none; }
.lsc-title { margin: 0; font-family: var(--font-head, "Fira Sans", Helvetica, Arial, sans-serif); font-weight: 700; font-size: 16px; line-height: 1.25; color: #fff; }
.lsc-sub { margin: 0; font-size: 13px; opacity: .85; }
.lsc-x {
  margin-left: auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lsc-x:hover, .lsc-x:focus-visible { background: rgba(255, 255, 255, .15); outline: none; }
.lsc-x svg { width: 16px; height: 16px; fill: currentColor; }

.lsc-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  background: var(--ice, #f4f7fa);
  overscroll-behavior: contain;
}

.lsc-msg {
  max-width: 86%;
  margin: 0 0 10px;
  padding: 9px 13px;
  border-radius: 14px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.lsc-msg--bot { background: #fff; border: 1px solid var(--grey-line, #e2e6ea); border-bottom-left-radius: 4px; }
.lsc-msg--me { margin-left: auto; background: var(--blue-mid, #2f80a9); color: #fff; border-bottom-right-radius: 4px; }
.lsc-msg a { color: var(--teal-dark, #178086); font-weight: 700; text-decoration: underline; }
.lsc-msg--me a { color: #fff; }

.lsc-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.lsc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--grey-soft, #c7c7c7); animation: lsc-dot 1s infinite ease-in-out; }
.lsc-typing i:nth-child(2) { animation-delay: .15s; }
.lsc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes lsc-dot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* lead form, shown inside the conversation */
.lsc-form {
  margin: 0 0 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--grey-line, #e2e6ea);
  border-radius: 12px;
  display: grid;
  gap: 8px;
}
.lsc-form label { font-size: 13px; font-weight: 700; color: var(--navy, #0b3c5d); }
.lsc-form input, .lsc-form textarea {
  width: 100%;
  margin-top: 3px;
  padding: 8px 10px;
  border: 1px solid var(--grey-soft, #c7c7c7);
  border-radius: 6px;
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  color: inherit;
  background: #fff;
}
.lsc-form textarea { min-height: 70px; resize: vertical; }
.lsc-form input:focus, .lsc-form textarea:focus { outline: 2px solid var(--teal, #1fa4a9); outline-offset: 0; border-color: transparent; }
.lsc-form .lsc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lsc-form .lsc-err { margin: 0; font-size: 13px; color: #b3261e; }
.lsc-form button {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--navy, #0b3c5d);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.lsc-form button:hover, .lsc-form button:focus-visible { background: var(--teal, #1fa4a9); }
.lsc-form button[disabled] { opacity: .6; cursor: default; }
.lsc-form.is-done { display: none; }

/* quick replies + composer ------------------------------------------------ */

.lsc-quick {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid var(--grey-line, #e2e6ea);
  scrollbar-width: thin;
}
.lsc-chip {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--teal, #1fa4a9);
  border-radius: 999px;
  background: #fff;
  color: var(--teal-dark, #178086);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.lsc-chip:hover, .lsc-chip:focus-visible { background: var(--teal, #1fa4a9); color: #fff; outline: none; }
.lsc-chip--talk { border-color: var(--navy, #0b3c5d); color: var(--navy, #0b3c5d); font-weight: 700; }
.lsc-chip--talk:hover, .lsc-chip--talk:focus-visible { background: var(--navy, #0b3c5d); }

.lsc-compose {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
}
.lsc-compose input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--grey-soft, #c7c7c7);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  color: inherit;
}
.lsc-compose input:focus { outline: 2px solid var(--teal, #1fa4a9); border-color: transparent; }
.lsc-send {
  flex: none;
  width: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--teal, #1fa4a9);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lsc-send:hover, .lsc-send:focus-visible { background: var(--navy, #0b3c5d); outline: none; }
.lsc-send svg { width: 18px; height: 18px; fill: currentColor; }

/* phones: the panel becomes a full-screen sheet and the launcher hides,
   so nothing on the page sits under it while it is open */
@media (max-width: 520px) {
  .lsc { --lsc-gap: 14px; }
  .lsc-launch { width: 52px; height: 52px; }
  .lsc-panel {
    inset: 0;
    width: auto;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
  }
  .lsc.is-open .lsc-launch { display: none; }

  /* the one page rule in this file: room under the copyright line so the
     launcher never sits on top of the last line of the page */
  .ap-footer-legal { padding-bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .lsc-launch, .lsc-launch:hover { transition: none; transform: none; }
  .lsc-typing i { animation: none; }
}

@media print { .lsc { display: none; } }
