:root {
  --primary: #3b82f6;
  --secondary: #8b5cf6;

  --gradient-accent: linear-gradient(135deg, var(--primary), var(--secondary));

  /* Derived helpers */
  --primary-soft: rgba(59, 130, 246, 0.18);
  --primary-glow: rgba(59, 130, 246, 0.45);

  --bg: #0B0B0B;
  --card: #141414;
  --text: #ffffff;
  --muted: #9ca3af;
  --border-soft: #2a2a2a;
}


/* ================= CHAT LAUNCHER ================= */
#chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  cursor: pointer;
  background: var(--gradient-accent);
  box-shadow:
    0 14px 36px var(--primary-glow),
    0 0 0 6px var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: launcherPulse 2.5s infinite;
  transition: .3s;
}

.launcher-inner {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.launcher-icon {
  font-size: 22px;
}

.launcher-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.launcher-status {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

@keyframes launcherPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, .3);
  }

  70% {
    box-shadow: 0 0 0 16px rgba(59, 130, 246, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* ================= CHAT WIDGET ================= */
#chat-widget {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 560px;
  background: var(--bg);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .55);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  transform: scale(.2);
  opacity: 0;
  transform-origin: bottom right;
  transition: .35s;
}

#chat-widget.morph-in {
  transform: scale(1);
  opacity: 1;
}

/* ================= HEADER ================= */
#chat-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text)
}

#chat-header .left {
  display: flex;
  gap: 12px;
  align-items: center;
}

#chat-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

#tenant-name {
  font-size: 15px;
  font-weight: 600;
}

#chatbot-name {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .12);
  display: inline-block;
}

.status {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status .dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
}

.action {
  display: flex;
  gap: 8px;
}

.action button {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
}

/* ================= BODY ================= */
#chat-body {
  flex: 1;
  background: var(--bg);
  padding: 16px;
  overflow-y: auto;
}

.chat-message {
  display: flex;
  flex-direction: column;
}

.chat-message.user {
  align-items: flex-end;
}

.chat-message.bot {
  align-items: flex-start;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
}

.chat-bubble.user {
  background: #1f1f1f;
  border: 1px solid var(--border-soft);
  color: var(--text);
}

.chat-bubble.bot {
  background: linear-gradient(135deg,
      var(--primary-soft),
      rgba(0, 0, 0, 0));
  border: 1px solid var(--primary-soft);
  color: var(--text)
}

.chat-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* ================= INPUT ================= */
.chat-input-bar {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-top: 1px solid var(--border-soft);
}

.chat-text-input {
  flex: 1;
  height: 48px;
  border-radius: 999px;
  padding: 0 18px;
  border: 1px solid var(--border-soft);
  background: var(--bg);
  color: var(--text);
}

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--gradient-accent);
  color: var(--text);
  border: none;
  cursor: pointer;
}

/* ================= LEAD FORM ================= */
.lead-form {
  background: var(--bg);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--border-soft);
}

.lead-header p,
.lead-footer {
  color: var(--muted);
}



/* ================= FIXED DARK LEAD FORM ================= */

.lead-form-wrapper {
  margin-top: 14px;
}

.lead-form {
  background: var(--bg);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid #2a2a2a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Header */
.lead-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.lead-avatar {
  width: 42px;
  height: 42px;
  background: var(--gradient-accent);
  color: var(--text);
  border-radius: 50%;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lead-header h4 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.lead-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

/* Fields */
.lead-fields .field {
  margin-top: 12px;
}

.lead-fields label {
  font-size: 12px;
  color: #cbd5f5;
  margin-bottom: 6px;
  display: block;
}

.lead-fields input {
  width: 90%;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;

  background: #0b0b0b;
  color: var(--text);

  border: 1px solid #2a2a2a;
  outline: none;
  transition: all 0.2s ease;
}

.lead-fields input::placeholder {
  color: #6b7280;
}

.lead-fields input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #0f0f0f;
}

/* Submit Button */
.lead-submit {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;

  border: none;
  background: var(--gradient-accent);
  box-shadow: 0 12px 26px var(--primary-glow);

  color: var(--text);

  font-weight: 600;
  cursor: pointer;

  transition: all 0.25s ease;
}

.lead-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(59, 130, 246, 0.55);
}

.lead-submit:active {
  transform: translateY(0);
}

/* Footer */
.lead-footer {
  margin-top: 12px;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}


/* ================= MINIMIZED STATE ================= */

#chat-widget.minimized {
  height: 64px;
  overflow: hidden;
}

/* Optional: subtle visual feedback */
#chat-widget.minimized #chat-header {
  cursor: pointer;
  background: var(--gradient-accent);
}

#chat-header .avatar {
  font-size: 17px;
}