/* Echo Affinity chat widget. Reads the site's design tokens (styles.css :root). */

.ea-chat-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--accent, #2f7fff);
  color: var(--accent-ink, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(47, 127, 255, 0.38);
  transition: transform 0.25s var(--ease, ease), box-shadow 0.25s var(--ease, ease);
}
.ea-chat-btn:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 36px rgba(47, 127, 255, 0.46); }
.ea-chat-btn svg { width: 26px; height: 26px; }

.ea-chat {
  position: fixed;
  right: 22px;
  bottom: 90px;
  z-index: 1200;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100dvh - 120px));
  display: none;
  flex-direction: column;
  background: var(--ink-2, #fff);
  color: var(--ivory, #0d1b2e);
  border: 1px solid var(--line, rgba(13, 27, 46, 0.13));
  border-radius: var(--radius, 14px);
  box-shadow: 0 24px 64px rgba(13, 27, 46, 0.22);
  overflow: hidden;
  font-family: var(--font-body, ui-sans-serif, system-ui, sans-serif);
}
.ea-chat.is-open { display: flex; }

.ea-chat__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #050d1c;
  color: #f2f6fd;
}
.ea-chat__head-title { font-family: var(--font-display, inherit); font-weight: 600; font-size: 15px; }
.ea-chat__head-sub { font-size: 12px; opacity: 0.62; }
.ea-chat__close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
}
.ea-chat__close:hover { opacity: 1; }

.ea-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--ink, #f5f7fb);
}
.ea-chat__msg {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ea-chat__msg--bot {
  align-self: flex-start;
  background: var(--ink-2, #fff);
  border: 1px solid var(--line-soft, rgba(13, 27, 46, 0.07));
  border-bottom-left-radius: 4px;
}
.ea-chat__msg--user {
  align-self: flex-end;
  background: var(--accent, #2f7fff);
  color: var(--accent-ink, #fff);
  border-bottom-right-radius: 4px;
}
.ea-chat__msg--typing { color: var(--ivory-mute, rgba(13, 27, 46, 0.42)); }

.ea-chat__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ea-chat__chip {
  border: 1px solid var(--accent, #2f7fff);
  background: transparent;
  color: var(--accent-deep, #1f68e0);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.ea-chat__chip:hover { background: var(--accent, #2f7fff); color: var(--accent-ink, #fff); }

.ea-chat__foot { border-top: 1px solid var(--line-soft, rgba(13, 27, 46, 0.07)); background: var(--ink-2, #fff); }
.ea-chat__row { display: flex; gap: 8px; padding: 10px 12px 6px; }
.ea-chat__input {
  flex: 1;
  border: 1px solid var(--line, rgba(13, 27, 46, 0.13));
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: inherit;
  background: var(--ink, #f5f7fb);
  resize: none;
  max-height: 92px;
}
.ea-chat__input:focus { outline: 2px solid var(--accent, #2f7fff); outline-offset: -1px; }
.ea-chat__send {
  border: none;
  border-radius: 10px;
  background: var(--accent, #2f7fff);
  color: var(--accent-ink, #fff);
  width: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ea-chat__send:disabled { opacity: 0.5; cursor: default; }
.ea-chat__send svg { width: 18px; height: 18px; }
.ea-chat__leadlink {
  display: block;
  width: 100%;
  border: none;
  background: none;
  color: var(--ivory-mute, rgba(13, 27, 46, 0.42));
  font-size: 12px;
  padding: 4px 0 10px;
  cursor: pointer;
  text-decoration: underline;
}
.ea-chat__leadlink:hover { color: var(--accent-deep, #1f68e0); }

/* Lead form */
.ea-chat__lead { display: none; flex-direction: column; gap: 8px; padding: 12px 14px; }
.ea-chat.is-lead .ea-chat__lead { display: flex; }
.ea-chat.is-lead .ea-chat__row, .ea-chat.is-lead .ea-chat__leadlink { display: none; }
.ea-chat__lead input, .ea-chat__lead textarea {
  border: 1px solid var(--line, rgba(13, 27, 46, 0.13));
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  background: var(--ink, #f5f7fb);
  color: inherit;
}
.ea-chat__lead input:focus, .ea-chat__lead textarea:focus { outline: 2px solid var(--accent, #2f7fff); outline-offset: -1px; }
.ea-chat__lead-actions { display: flex; gap: 8px; }
.ea-chat__lead-send {
  flex: 1;
  border: none;
  border-radius: 10px;
  background: var(--accent, #2f7fff);
  color: var(--accent-ink, #fff);
  padding: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ea-chat__lead-cancel {
  border: 1px solid var(--line, rgba(13, 27, 46, 0.13));
  background: none;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  color: inherit;
  cursor: pointer;
}
.ea-chat__lead-note { font-size: 11px; color: var(--ivory-mute, rgba(13, 27, 46, 0.42)); margin: 0; }

@media (max-width: 480px) {
  .ea-chat { right: 12px; bottom: 82px; }
  .ea-chat-btn { right: 16px; bottom: 16px; }
}
