/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6C63FF;
  --primary-dark: #5a52e8;
  --secondary: #FF6584;
  --accent: #43CBFF;
  --success: #38D9A9;
  --bg: #F7F5FF;
  --bg2: #ffffff;
  --text: #1a1535;
  --text-muted: #6b6894;
  --border: rgba(108,99,255,0.15);
  --shadow: 0 8px 40px rgba(108,99,255,0.12);
  --shadow-hover: 0 20px 60px rgba(108,99,255,0.22);
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: 1.3rem; font-weight: 700; }
p { color: var(--text-muted); line-height: 1.75; }
a { color: var(--primary); text-decoration: none; }

/* ===== UTILITIES ===== */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(108,99,255,0.1); color: var(--primary);
  padding: 6px 14px; border-radius: 50px; font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 16px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 50px;
  font-weight: 700; font-size: 0.95rem; cursor: pointer;
  border: none; transition: all 0.25s ease; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; box-shadow: 0 6px 24px rgba(108,99,255,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px); box-shadow: 0 12px 36px rgba(108,99,255,0.45);
}
.btn-ghost {
  background: white; color: var(--primary);
  border: 2px solid var(--border); box-shadow: var(--shadow);
}
.btn-ghost:hover { border-color: var(--primary); transform: translateY(-2px); }
.btn-lg { padding: 18px 36px; font-size: 1.05rem; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247,245,255,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

/* ===== HERO ===== */
.hero {
  padding: 80px 0 60px;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(108,99,255,0.12) 0%, transparent 70%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -120px; right: -120px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,101,132,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.hero-content .tag::before { content: '✨'; }
.hero-title { margin-bottom: 20px; }
.hero-subtitle { font-size: 1.15rem; margin-bottom: 36px; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero-buttons { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.hero-stats {
  display: flex; justify-content: center; gap: 48px;
  margin-top: 40px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 1.6rem; font-weight: 800; color: var(--text); }
.hero-stat span { font-size: 0.82rem; color: var(--text-muted); }

/* ===== CHAT WIDGET ===== */
.chat-wrapper {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: 260px 1fr; gap: 0;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-hover), 0 0 0 1px var(--border);
  background: white;
  min-height: 540px;
}

/* Sidebar */
.chat-sidebar {
  background: linear-gradient(180deg, #f0eeff 0%, #fdf4f7 100%);
  border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 6px;
}
.sidebar-title {
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 10px 10px;
}
.mode-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  font-size: 0.875rem; font-weight: 500; color: var(--text);
  border: none; background: transparent; text-align: left; width: 100%;
  transition: all 0.18s;
}
.mode-btn:hover { background: rgba(108,99,255,0.08); color: var(--primary); }
.mode-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-weight: 600;
  box-shadow: 0 4px 16px rgba(108,99,255,0.28);
}
.mode-btn .icon { font-size: 1.1rem; min-width: 24px; text-align: center; }
.sidebar-sep {
  height: 1px; background: var(--border); margin: 6px 0;
}
.sidebar-badge {
  margin-top: auto; padding: 12px;
  background: white; border-radius: 12px; border: 1px solid var(--border);
  font-size: 0.78rem; text-align: center; color: var(--text-muted);
}
.sidebar-badge a { color: var(--primary); font-weight: 600; }

/* Chat main */
.chat-main { display: flex; flex-direction: column; }
.chat-topbar {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.chat-topbar-info { display: flex; align-items: center; gap: 10px; }
.ai-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.ai-name { font-weight: 700; font-size: 0.95rem; }
.ai-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.75rem; color: var(--success); font-weight: 500;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}
.chat-badge {
  background: rgba(108,99,255,0.08); color: var(--primary);
  padding: 4px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 600;
}

/* Messages */
.chat-messages {
  flex: 1; padding: 20px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 320px; max-height: 360px;
}
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg-ai { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.msg-user .msg-avatar {
  background: linear-gradient(135deg, var(--secondary), #ffb347);
}
.msg-bubble {
  padding: 12px 16px; border-radius: 18px; font-size: 0.9rem;
  line-height: 1.55;
}
.msg-ai .msg-bubble {
  background: #f3f1ff; color: var(--text); border-bottom-left-radius: 4px;
}
.msg-user .msg-bubble {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border-bottom-right-radius: 4px;
}
.msg-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; align-self: flex-end; }

/* Typing indicator */
.typing { display: flex; gap: 4px; align-items: center; padding: 8px 0; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); opacity: 0.4;
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-5px); opacity: 1; }
}

/* Input */
.chat-input-area {
  padding: 16px 20px; border-top: 1px solid var(--border);
  background: #fafafe;
}
.chat-input-row {
  display: flex; align-items: flex-end; gap: 10px;
  background: white; border: 2px solid var(--border);
  border-radius: 16px; padding: 10px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-row:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(108,99,255,0.1);
}
.chat-textarea {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font); font-size: 0.9rem; color: var(--text);
  resize: none; min-height: 22px; max-height: 120px; line-height: 1.5;
}
.chat-textarea::placeholder { color: var(--text-muted); }
.chat-send {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; box-shadow: 0 3px 12px rgba(108,99,255,0.3);
}
.chat-send:hover { transform: scale(1.08); box-shadow: 0 5px 18px rgba(108,99,255,0.4); }
.chat-send svg { width: 17px; height: 17px; }
.chat-hint { font-size: 0.72rem; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* ===== SECTION COMMONS ===== */
section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-header p { font-size: 1.05rem; margin-top: 14px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ===== BENEFITS ===== */
.benefits { background: white; }
.benefits-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px;
}
.benefit-card {
  padding: 32px 28px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--bg);
  transition: all 0.25s;
}
.benefit-card:hover {
  border-color: var(--primary); transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.benefit-icon {
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(108,99,255,0.12), rgba(255,101,132,0.12));
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.benefit-card h3 { margin-bottom: 10px; }

/* ===== HOW IT WORKS ===== */
.how-it-works { background: var(--bg); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; position: relative; }
.step {
  text-align: center; padding: 36px 24px;
  background: white; border-radius: var(--radius);
  border: 1.5px solid var(--border); position: relative;
  transition: all 0.25s;
}
.step:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.step-num {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-weight: 800; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.step h3 { margin-bottom: 10px; }

/* ===== USE CASES ===== */
.use-cases { background: white; }
.usecases-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px;
}
.usecase-card {
  padding: 28px 22px; border-radius: var(--radius);
  background: linear-gradient(145deg, #f9f7ff 0%, #fff4f6 100%);
  border: 1.5px solid var(--border); cursor: pointer;
  transition: all 0.22s; text-align: center;
}
.usecase-card:hover {
  transform: translateY(-4px); border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(108,99,255,0.15);
}
.usecase-icon { font-size: 2.4rem; margin-bottom: 12px; }
.usecase-card h3 { font-size: 1rem; margin-bottom: 6px; }
.usecase-card p { font-size: 0.82rem; }

/* ===== FEATURES ===== */
.features { background: var(--bg); }
.features-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.feature-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 24px; background: white; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); transition: all 0.22s;
}
.feature-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.feature-icon {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.feature-item h3 { font-size: 1rem; margin-bottom: 5px; }
.feature-item p { font-size: 0.855rem; }

/* ===== ALTERNATIVE BANNER ===== */
.alt-banner {
  background: linear-gradient(135deg, #6C63FF 0%, #FF6584 100%);
  padding: 60px 0; text-align: center;
}
.alt-banner h2, .alt-banner p { color: white; }
.alt-banner p { opacity: 0.85; margin: 12px auto 28px; max-width: 540px; }
.btn-white {
  background: white; color: var(--primary); font-weight: 700;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(0,0,0,0.2); }

/* ===== SEO TEXT ===== */
.seo-section { background: white; }
.seo-inner { max-width: 820px; margin: 0 auto; }
.seo-inner h2 { margin-bottom: 18px; }
.seo-inner p { margin-bottom: 16px; font-size: 0.97rem; }
.seo-inner h3 { margin: 28px 0 10px; color: var(--text); font-size: 1.1rem; }

/* ===== FAQ ===== */
.faq { background: var(--bg); }
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: white; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  overflow: hidden; transition: border-color 0.2s;
}
.faq-item:hover { border-color: var(--primary); }
.faq-q {
  padding: 20px 24px; font-weight: 700; font-size: 0.97rem; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.faq-q .chevron {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(108,99,255,0.1); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; transition: transform 0.25s; flex-shrink: 0;
}
.faq-item.open .faq-q .chevron { transform: rotate(180deg); background: var(--primary); color: white; }
.faq-a {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 24px; font-size: 0.9rem; color: var(--text-muted); line-height: 1.7;
}
.faq-item.open .faq-a { max-height: 300px; padding: 0 24px 20px; }

/* ===== CTA FINAL ===== */
.cta-final {
  background: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(108,99,255,0.08) 0%, transparent 70%);
  text-align: center; padding: 120px 0;
}
.cta-final h2 { margin-bottom: 16px; }
.cta-final p { font-size: 1.05rem; margin-bottom: 36px; max-width: 520px; margin-left: auto; margin-right: auto; }
.cta-buttons { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ===== FOOTER ===== */
footer {
  background: var(--text); color: rgba(255,255,255,0.6);
  padding: 48px 0 28px;
}
.footer-inner {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; margin-bottom: 40px;
}
.footer-brand .logo { color: white; margin-bottom: 12px; }
.footer-brand p { font-size: 0.875rem; max-width: 280px; }
footer h4 { color: white; font-size: 0.9rem; margin-bottom: 14px; }
footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
footer ul li a { color: rgba(255,255,255,0.55); font-size: 0.875rem; transition: color 0.2s; }
footer ul li a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 0.82rem;
}
.footer-bottom a { color: rgba(255,255,255,0.55); }
.footer-bottom a:hover { color: white; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .chat-wrapper { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

@media (max-width: 640px) {
  section { padding: 72px 0; }
  .hero { padding: 56px 0 40px; }
  .hero-stats { gap: 28px; }
  .btn-lg { padding: 15px 26px; font-size: 0.97rem; }
  .chat-messages { min-height: 280px; max-height: 300px; }
}

/* ===== SCROLL ANIMATIONS ===== */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
