/* FXCompare chat widget — floating assistant + leave-a-message form.
   Pure CSS, no external deps. Brand: navy #0a1f3c / accent #1f6feb. */

.fxchat-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #0a1f3c;
  color: #fff;
  cursor: pointer;
  z-index: 99990;
  box-shadow: 0 6px 20px rgba(10, 31, 60, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, background .15s ease;
}
.fxchat-fab:hover { background: #143055; transform: translateY(-2px); }
.fxchat-fab svg { width: 28px; height: 28px; display: block; }
.fxchat-fab .fxchat-dot {
  position: absolute; top: -2px; right: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #1f6feb; border: 2px solid #fff;
}

.fxchat-panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(10, 31, 60, 0.28);
  z-index: 99991;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1a2233;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.fxchat-panel.fxchat-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.fxchat-head {
  background: #0a1f3c;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fxchat-head .fxchat-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #1f6feb; display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.fxchat-head .fxchat-avatar svg { width: 20px; height: 20px; }
.fxchat-head .fxchat-titles { flex: 1 1 auto; min-width: 0; }
.fxchat-head .fxchat-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.fxchat-head .fxchat-status { font-size: 12px; opacity: .8; display: flex; align-items: center; gap: 5px; }
.fxchat-head .fxchat-status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34d399; display: inline-block;
}
.fxchat-head .fxchat-close {
  background: transparent; border: none; color: #fff; cursor: pointer;
  font-size: 22px; line-height: 1; padding: 2px 6px; opacity: .85;
}
.fxchat-head .fxchat-close:hover { opacity: 1; }

.fxchat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 14px 6px;
  background: #f5f7fb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fxchat-msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; word-wrap: break-word; }
.fxchat-msg a { color: #1f6feb; font-weight: 600; text-decoration: none; }
.fxchat-msg a:hover { text-decoration: underline; }
.fxchat-bot { align-self: flex-start; background: #fff; border: 1px solid #e4e9f2; border-bottom-left-radius: 4px; }
.fxchat-user { align-self: flex-end; background: #1f6feb; color: #fff; border-bottom-right-radius: 4px; }
.fxchat-typing { align-self: flex-start; background: #fff; border: 1px solid #e4e9f2; border-bottom-left-radius: 4px; font-style: italic; opacity: .7; }

.fxchat-quick {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; background: #f5f7fb;
}
.fxchat-chip {
  border: 1px solid #c9d6ea; background: #fff; color: #0a1f3c;
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer;
  transition: background .12s ease;
}
.fxchat-chip:hover { background: #eaf1ff; }

.fxchat-input {
  display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e4e9f2; background: #fff;
}
.fxchat-input input {
  flex: 1 1 auto; border: 1px solid #cdd6e6; border-radius: 10px; padding: 9px 12px; font-size: 14px; outline: none;
}
.fxchat-input input:focus { border-color: #1f6feb; }
.fxchat-input button {
  border: none; background: #1f6feb; color: #fff; border-radius: 10px; padding: 0 14px;
  font-weight: 600; cursor: pointer; font-size: 14px;
}
.fxchat-input button:hover { background: #1857c4; }

/* Leave-a-message mini form (slides in over the body) */
.fxchat-form {
  position: absolute; inset: 0; background: #f5f7fb; padding: 16px;
  display: none; flex-direction: column; gap: 10px; overflow-y: auto;
}
.fxchat-form.fxchat-show { display: flex; }
.fxchat-form h4 { margin: 0 0 2px; color: #0a1f3c; font-size: 15px; }
.fxchat-form p.fxchat-hint { margin: 0; font-size: 12.5px; color: #5b6678; }
.fxchat-form label { font-size: 13px; font-weight: 600; color: #243049; display: flex; flex-direction: column; gap: 4px; }
.fxchat-form input, .fxchat-form textarea {
  border: 1px solid #cdd6e6; border-radius: 9px; padding: 9px 11px; font-size: 14px; font-family: inherit; outline: none;
}
.fxchat-form input:focus, .fxchat-form textarea:focus { border-color: #1f6feb; }
.fxchat-form textarea { resize: vertical; min-height: 80px; }
.fxchat-form .fxchat-form-actions { display: flex; gap: 8px; margin-top: 2px; }
.fxchat-form .fxchat-send {
  flex: 1 1 auto; border: none; background: #1f6feb; color: #fff; border-radius: 9px; padding: 10px 0; font-weight: 700; cursor: pointer;
}
.fxchat-form .fxchat-send:hover { background: #1857c4; }
.fxchat-form .fxchat-cancel {
  border: 1px solid #cdd6e6; background: #fff; color: #243049; border-radius: 9px; padding: 10px 14px; cursor: pointer; font-weight: 600;
}
.fxchat-form .fxchat-note { font-size: 12.5px; padding: 8px 10px; border-radius: 8px; display: none; }
.fxchat-form .fxchat-note.fxchat-ok { display: block; background: #e7f8ef; color: #15734a; }
.fxchat-form .fxchat-note.fxchat-err { display: block; background: #fdeaea; color: #b42318; }
.fxchat-privacy { font-size: 11.5px; color: #7a8499; margin: 0; }
.fxchat-privacy a { color: #1f6feb; text-decoration: underline; }
.fxchat-consent {
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 8px !important;
  font-weight: 500 !important;
  color: #3a4357 !important;
  font-size: 12px !important;
  line-height: 1.4;
  cursor: pointer;
}
.fxchat-consent input[type="checkbox"] { margin-top: 2px; width: 16px; height: 16px; flex: 0 0 auto; }

/* RTL adjustments */
[dir="rtl"] .fxchat-fab { right: auto; left: 20px; }
[dir="rtl"] .fxchat-panel { right: auto; left: 20px; }
[dir="rtl"] .fxchat-bot { align-self: flex-end; border-bottom-left-radius: 12px; border-bottom-right-radius: 4px; }
[dir="rtl"] .fxchat-user { align-self: flex-start; border-bottom-right-radius: 12px; border-bottom-left-radius: 4px; }

@media (max-width: 420px) {
  .fxchat-panel { right: 8px; left: 8px; bottom: 76px; width: auto; max-width: none; }
  [dir="rtl"] .fxchat-panel { right: 8px; left: 8px; }
}
