/* ═══════════ BASE ═══════════ */
:root {
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --accent: #06b6d4;
  --success: #10b981;
  --dark: #111827;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--dark);
}

main { flex: 1; }

/* ═══════════ SHARED SECTION STYLES ═══════════ */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ═══════════ NAVBAR ═══════════ */
.navbar {
  border-bottom: 1px solid var(--gray-200);
  background: #fff !important;
  padding: 12px 0;
}

.navbar-brand {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary) !important;
  text-decoration: none;
}

.brand-icon { font-size: 1.4rem; }

.navbar .nav-link {
  color: var(--gray-600) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px !important;
  border-radius: 999px;
  transition: background 0.15s;
}

.navbar .nav-link:hover {
  background: var(--gray-100);
  color: var(--dark) !important;
}

/* ═══════════ HERO ═══════════ */
.hero-section {
  background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 50%, #e0e7ff 100%);
  padding: 80px 0 60px;
  overflow: hidden;
}

.hero-badge {
  display: inline-block;
  background: rgba(139, 92, 246, 0.1);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  color: var(--dark);
  margin-bottom: 20px;
}

.hero-accent { color: var(--primary); }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--gray-600);
  line-height: 1.7;
  max-width: 540px;
  margin-bottom: 24px;
}

/* ─── Hero stats row ─── */
.hero-stats-row {
  display: flex;
  gap: 32px;
  margin-bottom: 28px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 4px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
}

/* ─── Code block in hero ─── */
.hero-code {
  background: #1e1b4b;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-code-header {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  align-items: center;
}

.hero-code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}

.hero-code-label {
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  margin-left: auto;
  font-family: monospace;
}

.hero-code pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.6;
}

.hero-code code {
  color: #e2e8f0;
}

.code-comment { color: #6b7280; }
.code-keyword { color: #c084fc; }
.code-string { color: #34d399; }

/* ═══════════ PAIN SECTION ═══════════ */
.pain-section {
  padding: 80px 0;
  background: #fff;
}

.pain-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pain-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 24px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
}

.pain-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.pain-card strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--dark);
}

.pain-card p {
  font-size: 0.88rem;
  color: var(--gray-600);
  margin: 0;
  line-height: 1.5;
}

/* ═══════════ PRIMITIVES SECTION ═══════════ */
.primitives-section {
  padding: 80px 0;
  background: var(--gray-50);
}

.primitive-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  height: 100%;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.primitive-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.primitive-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.primitive-icon-new {
  width: 48px;
  height: 48px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 16px;
}

.primitive-card h5 {
  font-weight: 700;
  margin-bottom: 8px;
}

.primitive-card p {
  color: var(--gray-600);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.primitive-card code {
  font-size: 0.78rem;
  color: var(--primary);
  background: rgba(139, 92, 246, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
}

.primitive-use-case {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-style: italic;
}

/* ═══════════ HOW IT WORKS ═══════════ */
.how-section {
  padding: 80px 0;
  background: #fff;
}

.how-step {
  text-align: center;
  padding: 32px 24px;
}

.how-step-num {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.how-step h4 { font-weight: 700; margin-bottom: 8px; }
.how-step p { color: var(--gray-600); font-size: 0.95rem; }

/* ═══════════ ICP SECTION ═══════════ */
.icp-section {
  padding: 80px 0;
  background: var(--gray-50);
}

.icp-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  height: 100%;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.icp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.icp-icon {
  width: 56px;
  height: 56px;
  background: rgba(139, 92, 246, 0.08);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 16px;
}

.icp-card h5 {
  font-weight: 700;
  margin-bottom: 8px;
}

.icp-card p {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 0;
  line-height: 1.5;
}

.icp-card a {
  color: var(--primary);
}

/* ═══════════ COMPARISON TABLE ═══════════ */
.compare-section {
  padding: 80px 0;
  background: #fff;
}

.compare-table-wrapper {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--gray-200);
}

.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
}

.compare-table thead th {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gray-200);
}

.compare-table thead th.compare-us {
  color: var(--primary);
}

.compare-table td.compare-us {
  background: rgba(139, 92, 246, 0.04);
  color: var(--primary);
  font-weight: 600;
}

.compare-table tbody tr:hover {
  background: var(--gray-50);
}

/* ═══════════ USE CASES ═══════════ */
.usecases-section {
  padding: 80px 0;
  background: var(--gray-50);
}

.usecase-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  height: 100%;
  transition: transform 0.15s;
}

.usecase-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.usecase-card h5 {
  font-weight: 700;
  margin-bottom: 8px;
}

.usecase-card p {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 0;
  line-height: 1.5;
}

.usecase-card a {
  color: var(--primary);
}

/* ═══════════ ARCHITECTURE ═══════════ */
.arch-section {
  padding: 80px 0;
  background: #fff;
}

.arch-features {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.arch-feature strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.arch-feature p {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

/* ─── Architecture diagram ─── */
.arch-diagram {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  justify-content: center;
}

.arch-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.arch-node {
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  min-width: 180px;
}

.arch-node small {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  margin-top: 2px;
  opacity: 0.7;
}

.arch-node-agent {
  background: var(--dark);
  color: #fff;
}

.arch-node-api {
  background: var(--primary);
  color: #fff;
}

.arch-node-redis {
  background: #dc2626;
  color: #fff;
}

.arch-node-mongo {
  background: #16a34a;
  color: #fff;
}

.arch-arrow {
  font-size: 1.2rem;
  color: var(--gray-400);
}

.arch-arrow-split {
  display: flex;
  gap: 24px;
  margin-top: 4px;
}

.arch-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ═══════════ PRICING PREVIEW ═══════════ */
.pricing-preview-section {
  padding: 80px 0;
  background: var(--gray-50);
}

.pricing-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  height: 100%;
  position: relative;
}

.pricing-card-featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.pricing-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 16px;
  border-radius: 999px;
}

.pricing-card h4 {
  font-weight: 700;
  margin-bottom: 8px;
}

.pricing-amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 20px;
}

.pricing-amount small {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--gray-600);
}

.pricing-card ul {
  list-style: none;
  padding: 0;
  margin-bottom: 24px;
  text-align: left;
}

.pricing-card ul li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-100);
}

.pricing-card ul li:last-child {
  border-bottom: none;
}

/* ═══════════ MARKET CONTEXT ═══════════ */
.market-section {
  padding: 80px 0;
  background: #fff;
}

.market-stats {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.market-stat {
  display: flex;
  flex-direction: column;
}

.market-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.market-stat-label {
  font-size: 0.82rem;
  color: var(--gray-600);
  margin-top: 4px;
  max-width: 180px;
}

.market-quote {
  background: linear-gradient(135deg, #faf5ff, #ede9fe);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 32px;
}

.market-quote blockquote {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--dark);
  line-height: 1.6;
  margin-bottom: 12px;
}

.market-quote cite {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-style: normal;
}

/* ═══════════ CTA SECTION ═══════════ */
.cta-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  color: #fff;
}

.cta-section h2 { font-weight: 800; font-size: 2.2rem; margin-bottom: 8px; }
.cta-sub { color: rgba(255,255,255,0.7); font-size: 1.1rem; margin-bottom: 28px; }

.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.cta-section .btn-primary { background: #fff; color: var(--primary); border: none; font-weight: 600; }
.cta-section .btn-primary:hover { background: #f3f4f6; color: var(--primary-dark); }
.cta-section .btn-outline-light { border-color: rgba(255,255,255,0.3); color: #fff; }
.cta-section .btn-outline-light:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }

/* ═══════════ FOOTER ═══════════ */
footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 32px 0 !important;
}

/* ═══════════ AUTH SPLIT LAYOUT ═══════════ */
.auth-split {
  display: flex;
  min-height: calc(100vh - 120px);
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -1.5rem;
  margin-bottom: -1.5rem;
}

.auth-marketing {
  flex: 1;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #7c3aed 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.auth-marketing-inner { max-width: 440px; }

.auth-marketing-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}

.auth-marketing-sub {
  font-size: 1.05rem;
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 32px;
}

.auth-value-props { display: flex; flex-direction: column; gap: 20px; }

.auth-value-prop {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.auth-value-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.auth-value-prop strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.auth-value-prop p {
  font-size: 0.85rem;
  opacity: 0.75;
  margin: 0;
  line-height: 1.5;
}

.auth-social-proof {
  display: flex;
  gap: 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.auth-stat-num { display: block; font-weight: 700; font-size: 1.1rem; }
.auth-stat-label { font-size: 0.8rem; opacity: 0.65; }

.auth-form-col {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: #fff;
}

.auth-form-inner {
  width: 100%;
  max-width: 400px;
}

@media (max-width: 768px) {
  .auth-split { flex-direction: column; }
  .auth-marketing { padding: 32px 24px; }
  .auth-form-col { padding: 32px 24px; }
  .hero-title { font-size: 2rem; }
  .hero-stats-row { gap: 20px; }
  .market-stats { gap: 20px; }
  .arch-arrow-split { flex-direction: column; }
  .cta-buttons { flex-direction: column; align-items: center; }
}

/* ═══════════ STAT CARDS ═══════════ */
.stat-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
}

/* ═══════════ MESSAGES LIST ═══════════ */
.messages-list {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 500px;
  overflow-y: auto;
}

.message-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.message-item:last-child { border-bottom: none; }

.message-role {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  min-width: 70px;
  text-align: center;
}

.message-item--user .message-role { background: #dbeafe; color: #1e40af; }
.message-item--assistant .message-role { background: #dcfce7; color: #166534; }
.message-item--system .message-role { background: #fef3c7; color: #92400e; }
.message-item--tool .message-role { background: #e0e7ff; color: #3730a3; }

.message-content {
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ═══════════ CARDS ═══════════ */
.card {
  border-radius: var(--radius);
  border-color: var(--gray-200);
}

.card-header {
  background: var(--gray-50);
  border-bottom-color: var(--gray-200);
}

/* ═══════════ BUTTONS ═══════════ */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* ═══════════ TRUST / WHY SECTION (kept for other pages) ═══════════ */
.trust-section {
  padding: 80px 0;
  background: #fff;
}

.trust-card {
  padding: 32px 24px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  height: 100%;
}

.trust-card h5 { font-weight: 700; margin-bottom: 8px; }
.trust-card p { color: var(--gray-600); font-size: 0.95rem; margin-bottom: 0; }
