/* Chatbot widget — embedded on landing page */
:root {
  --cbg: #0c0c0c;
  --csurface: #161616;
  --ccard: #1c1c1c;
  --corange: #f97316;
  --camber: #fbbf24;
  --ctext: #f5f5f5;
  --cmuted: #a8a8a8;
  --cborder: #2a2a2a;
}

#chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Manrope', sans-serif;
}

/* Launcher button */
#chat-launcher {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--corange);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(249, 115, 22, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
#chat-launcher:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 32px rgba(249, 115, 22, 0.55);
}
#chat-launcher svg { width: 28px; height: 28px; fill: white; }
#chat-launcher.open { background: var(--csurface); border: 2px solid var(--cborder); }
#chat-launcher.open svg { fill: var(--ctext); }

/* Chat window */
#chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: var(--csurface);
  border: 1px solid var(--cborder);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 64px rgba(0,0,0,0.6);
  transition: opacity 0.2s, transform 0.2s;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
}
#chat-window.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.cw-header {
  padding: 20px 20px 16px;
  background: var(--ccard);
  border-bottom: 1px solid var(--cborder);
  display: flex;
  align-items: center;
  gap: 12px;
}
.cw-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--corange), var(--camber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.cw-header-info h3 {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ctext);
  margin-bottom: 2px;
}
.cw-header-info p {
  font-size: 12px;
  color: var(--cmuted);
}
.cw-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #4ade80;
  margin-top: 2px;
}
.cw-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.cw-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cmuted);
  font-size: 20px;
  padding: 4px;
  line-height: 1;
}
.cw-close:hover { color: var(--ctext); }

/* Messages */
.cw-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cw-messages::-webkit-scrollbar { width: 6px; }
.cw-messages::-webkit-scrollbar-track { background: transparent; }
.cw-messages::-webkit-scrollbar-thumb { background: var(--cborder); border-radius: 3px; }

.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--corange); color: white; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--ccard); color: var(--ctext); border: 1px solid var(--cborder); border-bottom-left-radius: 4px; }

.msg-calendly {
  align-self: stretch;
  background: var(--ccard);
  border: 1px solid var(--cborder);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.msg-calendly h4 { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; color: var(--ctext); margin-bottom: 8px; }
.msg-calendly p { font-size: 13px; color: var(--cmuted); margin-bottom: 12px; }
.msg-calendly button {
  background: var(--corange);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.msg-calendly button:hover { background: #ea580c; }

/* Quick options */
.msg-options {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opt-btn {
  background: var(--ccard);
  border: 1px solid var(--cborder);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  color: var(--ctext);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'Manrope', sans-serif;
}
.opt-btn:hover { border-color: var(--corange); background: rgba(249,115,22,0.08); }

/* Input area */
.cw-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--cborder);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.cw-input {
  flex: 1;
  background: var(--ccard);
  border: 1px solid var(--cborder);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--ctext);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  resize: none;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s;
}
.cw-input::placeholder { color: var(--cmuted); }
.cw-input:focus { border-color: var(--corange); }
.cw-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--corange);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.cw-send:hover { background: #ea580c; }
.cw-send svg { width: 18px; height: 18px; fill: white; }

/* Loading dots */
.loading-dots { display: flex; gap: 4px; padding: 12px 0; }
.loading-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cmuted);
  animation: dot-bounce 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Typing indicator */
.typing-indicator { display: flex; gap: 4px; }
.typing-indicator span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cmuted);
  animation: dot-bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@media (max-width: 480px) {
  #chat-widget { bottom: 16px; right: 16px; }
  #chat-window { width: calc(100vw - 32px); }
}