/* HLT Technology — chat widget */

.hlt-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: var(--font, "Manrope", system-ui, sans-serif);
}

.hlt-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--gradient-blue, linear-gradient(135deg, #2f7fd1, #1a5fa8));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow, 0 12px 28px -10px rgba(47, 127, 209, 0.45));
  transition: transform 0.2s var(--ease, ease), box-shadow 0.2s ease;
}

.hlt-chat-toggle:hover {
  transform: translateY(-2px) scale(1.04);
}

.hlt-chat-toggle svg {
  width: 26px;
  height: 26px;
  display: block;
}

.hlt-chat-toggle .hlt-icon-close {
  display: none;
}

.hlt-chat.is-open .hlt-chat-toggle .hlt-icon-chat {
  display: none;
}

.hlt-chat.is-open .hlt-chat-toggle .hlt-icon-close {
  display: block;
}

.hlt-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-pink, #e84a5f);
  border: 2px solid #fff;
}

.hlt-chat-window {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 110px);
  background: var(--surface, #fff);
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--shadow-md, 0 16px 40px -16px rgba(26, 35, 50, 0.18)), 0 0 0 1px var(--line, rgba(26,35,50,0.1));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s var(--ease, ease), transform 0.18s var(--ease, ease);
}

.hlt-chat.is-open .hlt-chat-window {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Elements toggled via the native `hidden` attribute must actually disappear,
   even though some of them also set their own `display` (e.g. flex) when visible. */
.hlt-chat-window [hidden] {
  display: none !important;
}

.hlt-chat-header {
  background: var(--gradient-blue, linear-gradient(135deg, #2f7fd1, #1a5fa8));
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.hlt-chat-header-title {
  display: block;
  font-weight: 700;
  font-size: 15px;
}

.hlt-chat-header-sub {
  display: block;
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.hlt-chat-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hlt-chat-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.hlt-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-alt, #f4f7fb);
}

.hlt-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.hlt-msg-bot {
  align-self: flex-start;
  background: #fff;
  color: var(--ink, #1a2332);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm, 0 2px 10px -4px rgba(26,35,50,0.12));
}

.hlt-msg-user {
  align-self: flex-end;
  background: var(--gradient-blue, linear-gradient(135deg, #2f7fd1, #1a5fa8));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.hlt-msg-bot .hlt-msg-p {
  margin: 0 0 8px 0;
}

.hlt-msg-bot .hlt-msg-p:last-child {
  margin-bottom: 0;
}

.hlt-msg-bot .hlt-msg-list {
  margin: 2px 0 8px 0;
  padding-left: 18px;
  list-style: none;
}

.hlt-msg-bot .hlt-msg-list:last-child {
  margin-bottom: 0;
}

.hlt-msg-bot .hlt-msg-list li {
  position: relative;
  margin: 4px 0;
  padding-left: 12px;
}

.hlt-msg-bot .hlt-msg-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient-blue, linear-gradient(135deg, #2f7fd1, #1a5fa8));
}

.hlt-msg-bot strong {
  font-weight: 700;
  color: var(--ink, #1a2332);
}

.hlt-msg-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm, 0 2px 10px -4px rgba(26,35,50,0.12));
}

.hlt-msg-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted, #6b7280);
  animation: hlt-typing-bounce 1.1s infinite ease-in-out;
}

.hlt-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.hlt-msg-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes hlt-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.hlt-chat-intake {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 20px;
  background: var(--surface-alt, #f4f7fb);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hlt-chat-intake-intro {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-soft, #4a5568);
}

.hlt-chat-intake-form,
#hlt-chat-intake-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hlt-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink, #1a2332);
}

.hlt-field em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted, #6b7280);
}

.hlt-field input {
  border: 1px solid var(--line, rgba(26,35,50,0.1));
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 400;
  color: var(--ink, #1a2332);
  background: #fff;
  outline: none;
}

.hlt-field input:focus {
  border-color: var(--blue, #2f7fd1);
}

.hlt-chat-intake-error {
  margin: 0;
  font-size: 12.5px;
  color: var(--accent-pink, #e84a5f);
  font-weight: 600;
}

.hlt-chat-intake-submit {
  margin-top: 4px;
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--gradient-blue, linear-gradient(135deg, #2f7fd1, #1a5fa8));
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm, 0 2px 10px -4px rgba(26,35,50,0.12));
}

.hlt-chat-intake-submit:hover {
  filter: brightness(1.05);
}

.hlt-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line, rgba(26,35,50,0.1));
  background: #fff;
  flex-shrink: 0;
}

.hlt-chat-input {
  flex: 1;
  border: 1px solid var(--line, rgba(26,35,50,0.1));
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

.hlt-chat-input:focus {
  border-color: var(--blue, #2f7fd1);
}

.hlt-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-blue, linear-gradient(135deg, #2f7fd1, #1a5fa8));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.hlt-chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}

.hlt-chat-send svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 520px) {
  .hlt-chat {
    right: 12px;
    bottom: 12px;
  }

  .hlt-chat-toggle {
    width: 54px;
    height: 54px;
  }

  .hlt-chat-window {
    position: fixed;
    inset: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .hlt-chat-header {
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .hlt-chat-input-row {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}
