/* ─── Autheflow Custom Styles ───────────────────────────────────────────────── */

/* Gradient animation */
@keyframes gradient-x {
  0%, 100% {
    background-size: 200% 200%;
    background-position: left center;
  }
  50% {
    background-size: 200% 200%;
    background-position: right center;
  }
}

.gradient-x {
  animation: gradient-x 3s ease infinite;
}

/* Fade in animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease both;
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.6s ease both;
}

/* Scroll animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Grid background */
.grid-bg {
  background-image:
    linear-gradient(to right, #80808012 1px, transparent 1px),
    linear-gradient(to bottom, #80808012 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
}

.dark .grid-bg {
  background-image:
    linear-gradient(to right, #ffffff0a 1px, transparent 1px),
    linear-gradient(to bottom, #ffffff0a 1px, transparent 1px);
}

/* Glowing orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
}

.orb-1 {
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: rgba(99, 102, 241, 0.2);
  animation: orbPulse1 8s ease-in-out infinite;
}

.orb-2 {
  top: 10%;
  left: 25%;
  width: 500px;
  height: 500px;
  background: rgba(34, 211, 238, 0.2);
  animation: orbPulse2 10s ease-in-out infinite;
}

.dark .orb-1 { background: rgba(79, 70, 229, 0.2); }
.dark .orb-2 { background: rgba(6, 182, 212, 0.1); }

@keyframes orbPulse1 {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.3; }
  50% { transform: translateX(-50%) scale(1.2); opacity: 0.5; }
}

@keyframes orbPulse2 {
  0%, 100% { transform: scale(1); opacity: 0.2; }
  50% { transform: scale(1.5); opacity: 0.4; }
}

/* Floating nodes animation */
.floating-node {
  animation: floatNode 6s ease-in-out infinite;
}

@keyframes floatNode {
  0%, 100% { opacity: 0.1; transform: translateY(0) translateX(0); }
  50% { opacity: 0.3; transform: translateY(-30px) translateX(20px); }
}

/* Spotlight card effect */
.spotlight-card .spotlight {
  background: radial-gradient(650px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99, 102, 241, 0.15), transparent 80%);
}

/* Chatbot styles */
#chatbot-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #4f46e5;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.3);
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.2s;
}

#chatbot-btn:hover { background: #4338ca; transform: scale(1.05); }

#chatbot-window {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 350px;
  max-width: calc(100vw - 3rem);
  height: 500px;
  max-height: calc(100vh - 6rem);
  border-radius: 1rem;
  background: white;
  border: 1px solid #e4e4e7;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatbotOpen 0.2s ease;
}

.dark #chatbot-window {
  background: #18181b;
  border-color: #27272a;
}

@keyframes chatbotOpen {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #4f46e5;
  padding: 0.75rem 1rem;
  color: white;
}

.chatbot-header h3 { font-weight: 600; font-size: 0.875rem; }
.chatbot-header button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: background 0.2s;
}
.chatbot-header button:hover { background: rgba(255,255,255,0.15); }

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fafafa;
}

.dark .chatbot-messages { background: rgba(9,9,11,0.5); }

.chat-msg {
  display: flex;
  gap: 0.5rem;
  max-width: 85%;
}

.chat-msg.user { flex-direction: row-reverse; align-self: flex-end; }
.chat-msg.agent { align-self: flex-start; }

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.chat-msg.user .chat-avatar { background: #e4e4e7; color: #52525b; }
.chat-msg.agent .chat-avatar { background: #e0e7ff; color: #4f46e5; }
.dark .chat-msg.user .chat-avatar { background: #27272a; color: #d4d4d8; }
.dark .chat-msg.agent .chat-avatar { background: rgba(79,70,229,0.2); color: #818cf8; }

.chat-bubble {
  border-radius: 1rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.chat-msg.user .chat-bubble {
  background: #4f46e5;
  color: white;
  border-top-right-radius: 0.25rem;
}

.chat-msg.agent .chat-bubble {
  background: white;
  border: 1px solid #e4e4e7;
  color: #3f3f46;
  border-top-left-radius: 0.25rem;
}

.dark .chat-msg.agent .chat-bubble {
  background: #18181b;
  border-color: #27272a;
  color: #e4e4e7;
}

.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fafafa;
  border-top: 1px solid #e4e4e7;
}

.dark .chatbot-suggestions { background: rgba(9,9,11); border-color: #27272a; }

.chatbot-suggestions button {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background: #e4e4e7;
  color: #3f3f46;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.dark .chatbot-suggestions button { background: #27272a; color: #d4d4d8; }
.chatbot-suggestions button:hover { background: #d4d4d8; }
.dark .chatbot-suggestions button:hover { background: #3f3f46; }

.chatbot-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: white;
  border-top: 1px solid #e4e4e7;
}

.dark .chatbot-input-area { background: #18181b; border-color: #27272a; }

.chatbot-input-area input {
  flex: 1;
  border-radius: 9999px;
  border: 1px solid #d4d4d8;
  background: #fafafa;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.dark .chatbot-input-area input {
  border-color: #3f3f46;
  background: rgba(9,9,11);
  color: #f4f4f5;
}

.chatbot-input-area input:focus { border-color: #4f46e5; }

.chatbot-input-area button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #4f46e5;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.chatbot-input-area button:hover { background: #4338ca; }
.chatbot-input-area button:disabled { background: #818cf8; cursor: default; }

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a1a1aa;
  animation: typingBounce 0.6s ease-in-out infinite;
}

.dark .typing-indicator span { background: #71717a; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
