/* ================================================================
   FORTYVA IA — Premium Landing Page (Refatorado)
   Dark Mode • Cloudflare Integration • WhatsApp Focus
================================================================ */

/* ---- Reset & Base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colors */
  --bg-primary:    #050510;
  --bg-secondary:  #080820;
  --bg-card:       #0d0d2b;
  --bg-card-hover: #111132;
  --bg-glass:      rgba(13, 13, 43, 0.85);

  --blue-500: #3b82f6;
  --purple-500: #8b5cf6;
  --cyan-400:  #22d3ee;
  --success:   #10b981;

  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
  --text-primary:   #f0f0ff;
  --text-secondary: #a0a0c0;
  --text-muted:     #606080;

  --border-subtle: rgba(255,255,255,0.06);
  --radius-lg: 24px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---- Typography -------------------------------------------- */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(59,130,246,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59,130,246,0.5);
}

/* Animação de Destaque para o WhatsApp */
.btn-ava-highlight {
  animation: pulseAva 2s infinite;
}

@keyframes pulseAva {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* ---- Form Styles (Cloudflare D1) --------------------------- */
#lead-form {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  max-width: 500px;
  margin: 0 auto;
}

#lead-form input, #lead-form select {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: white;
  outline: none;
}

#lead-form input:focus {
  border-color: var(--blue-500);
  background: rgba(59,130,246,0.05);
}

.btn-submit {
  width: 100%;
  justify-content: center;
  font-size: 1rem;
}

/* ---- Hero & Canvas ----------------------------------------- */
.hero {
  position: relative;
  padding: 160px 0 100px;
  text-align: center;
}

#hero-canvas {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  opacity: 0.5;
}

/* ---- Chat Widget (Otimizado) ------------------------------- */
#chat-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 10px 30px rgba(59,130,246,0.4);
}

#chat-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 350px;
  height: 450px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
}

#chat-window.open { display: flex; animation: fadeInUp 0.3s ease; }

#chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg-bubble {
  padding: 10px 15px;
  border-radius: 15px;
  font-size: 14px;
  max-width: 85%;
}

.chat-msg.bot .chat-msg-bubble { background: rgba(255,255,255,0.1); align-self: flex-start; }
.chat-msg.user .chat-msg-bubble { background: var(--blue-500); align-self: flex-end; }

#chat-input-area {
  padding: 15px;
  background: rgba(0,0,0,0.2);
  display: flex;
  gap: 10px;
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  outline: none;
}

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

[data-aos] { opacity: 0; transition: 0.8s ease-out; }
.aos-animate { opacity: 1; transform: none !important; }

/* ---- Responsive -------------------------------------------- */
@media (max-width: 768px) {
  .hero { padding-top: 120px; }
  #chat-window { width: 90%; right: 5%; bottom: 90px; }
}

/* Mensagem de sucesso do formulário */
.form-success-msg {
    text-align: center;
    padding: 40px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    border-radius: var(--radius-lg);
}