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

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a26;
  --border: rgba(255,255,255,0.08);
  --border-accent: rgba(124,58,237,0.4);
  --accent: #7c3aed;
  --accent-blue: #3b82f6;
  --accent-grad: linear-gradient(135deg, #7c3aed, #3b82f6);
  --text: #f0f0f5;
  --text-muted: #8888aa;
  --text-dim: #555570;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(124,58,237,0.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, textarea { font-family: inherit; }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { color: var(--text-muted); }

.gradient-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600;
  transition: all 0.2s ease; border: none; outline: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124,58,237,0.3);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,58,237,0.4); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card); border-color: var(--border-accent); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn-block { width: 100%; justify-content: center; }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: rgba(124,58,237,0.1); }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 16px 0;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.navbar.scrolled { background: rgba(10,10,15,0.95); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; font-weight: 700;
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; color: #fff;
  flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 8px; list-style: none; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-card); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-user { display: none; align-items: center; gap: 12px; }
.nav-user.active { display: flex; }
.nav-user span { font-size: 0.9rem; color: var(--text-muted); }
.nav-hamburger { display: none; background: none; border: none; color: var(--text); padding: 4px; }
.nav-hamburger svg { width: 22px; height: 22px; }

/* ===== HERO ===== */
.hero {
  padding: 160px 0 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 100px;
  border: 1px solid var(--border-accent);
  background: rgba(124,58,237,0.08);
  font-size: 0.8rem; font-weight: 500; color: #a78bfa;
  margin-bottom: 28px;
}
.hero-badge::before { content: '✦'; }
.hero h1 { margin-bottom: 20px; }
.hero p {
  font-size: 1.15rem; max-width: 580px; margin: 0 auto 40px;
  color: var(--text-muted);
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 48px; justify-content: center; flex-wrap: wrap;
  margin-top: 72px; padding-top: 48px; border-top: 1px solid var(--border);
}
.stat { text-align: center; }
.stat-value {
  font-size: 2.2rem; font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* ===== SECTION HEADER ===== */
.section-header { text-align: center; margin-bottom: 64px; }
.section-tag {
  display: inline-block; padding: 4px 14px; border-radius: 100px;
  background: rgba(124,58,237,0.12); border: 1px solid var(--border-accent);
  font-size: 0.78rem; font-weight: 600; color: #a78bfa; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 16px;
}
.section-header h2 { margin-bottom: 14px; }
.section-header p { max-width: 520px; margin: 0 auto; font-size: 1.05rem; }

/* ===== FEATURES ===== */
#features { background: linear-gradient(180deg, var(--bg) 0%, rgba(18,18,26,0.5) 100%); }
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}
.feature-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; font-size: 1.2rem;
}
.feature-card h3 { margin-bottom: 10px; }
.feature-card p { font-size: 0.9rem; }

/* ===== HOW IT WORKS ===== */
#how-it-works { background: var(--bg); }
.steps { display: flex; gap: 0; position: relative; }
.steps::before {
  content: '';
  position: absolute; top: 32px; left: calc(16.67% + 16px); right: calc(16.67% + 16px);
  height: 1px; background: linear-gradient(90deg, var(--accent), var(--accent-blue));
}
.step { flex: 1; text-align: center; padding: 0 24px; }
.step-num {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; color: #fff;
  margin: 0 auto 20px; position: relative; z-index: 1;
  box-shadow: 0 0 24px rgba(124,58,237,0.4);
}
.step h3 { margin-bottom: 8px; }
.step p { font-size: 0.9rem; }

/* ===== PRICING ===== */
#pricing { background: linear-gradient(180deg, rgba(18,18,26,0.5) 0%, var(--bg) 100%); }
.pricing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  align-items: start;
}
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  position: relative;
}
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent-grad); color: #fff;
  font-size: 0.75rem; font-weight: 700; padding: 4px 14px; border-radius: 100px;
  white-space: nowrap;
}
.pricing-card h3 { font-size: 1rem; color: var(--text-muted); margin-bottom: 16px; }
.price {
  display: flex; align-items: baseline; gap: 4px; margin-bottom: 8px;
}
.price-amount { font-size: 2.8rem; font-weight: 800; color: var(--text); }
.price-period { font-size: 0.9rem; color: var(--text-muted); }
.price-desc { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 28px; }
.pricing-features { list-style: none; margin-bottom: 28px; }
.pricing-features li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 0.9rem; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li::before { content: '✓'; color: #a78bfa; font-weight: 700; flex-shrink: 0; }

/* ===== CUSTOMIZATION ===== */
#customization { background: var(--bg); }
.custom-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.custom-content h2 { margin-bottom: 16px; }
.custom-content p { margin-bottom: 24px; }
.custom-list { list-style: none; margin-bottom: 32px; }
.custom-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; color: var(--text-muted); font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}
.custom-list li:last-child { border-bottom: none; }
.custom-list li::before { content: '◆'; color: var(--accent); font-size: 0.7rem; margin-top: 5px; flex-shrink: 0; }
.custom-visual {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  display: flex; flex-direction: column; gap: 16px;
}
.custom-step {
  display: flex; align-items: center; gap: 16px;
  padding: 14px; border-radius: var(--radius-sm);
  background: rgba(124,58,237,0.06); border: 1px solid rgba(124,58,237,0.15);
}
.custom-step-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.custom-step-text { font-size: 0.9rem; font-weight: 500; }
.custom-step-sub { font-size: 0.8rem; color: var(--text-muted); }

/* ===== CONTACT ===== */
#contact { background: linear-gradient(180deg, rgba(18,18,26,0.5) 0%, var(--bg) 100%); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.contact-info h2 { margin-bottom: 14px; }
.contact-info > p { margin-bottom: 32px; }
.contact-item {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px;
}
.contact-item-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: rgba(124,58,237,0.12); border: 1px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.contact-item-text strong { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.contact-item-text a { color: var(--accent-blue); font-size: 0.9rem; }
.contact-item-text a:hover { text-decoration: underline; }
.contact-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.contact-form h3 { margin-bottom: 24px; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
input, textarea, select {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; color: var(--text); font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
textarea { resize: vertical; min-height: 110px; }
.form-error { font-size: 0.8rem; color: #f87171; margin-top: 6px; display: none; }
.form-error.visible { display: block; }
.form-success {
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3);
  border-radius: var(--radius-sm); padding: 12px 16px;
  color: #86efac; font-size: 0.9rem; margin-top: 14px; display: none;
}
.form-success.visible { display: block; }
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
  font-size: 0.9rem; display: none;
}
.alert.visible { display: block; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

/* ===== FOOTER ===== */
footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 56px 0 32px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand p { font-size: 0.9rem; margin-top: 14px; max-width: 280px; }
.footer-col h4 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 0.9rem; color: var(--text-dim); transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 28px; border-top: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-dim);
}
.footer-bottom a { color: var(--text-dim); }
.footer-bottom a:hover { color: var(--text); }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 96px 24px 40px;
}
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px; width: 100%; max-width: 440px;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo a {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.15rem; font-weight: 700;
}
.auth-card h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; text-align: center; }
.auth-card .auth-sub { text-align: center; font-size: 0.9rem; margin-bottom: 28px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-dim); font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-footer { text-align: center; margin-top: 24px; font-size: 0.9rem; }
.auth-footer a { color: var(--accent-blue); }
.auth-footer a:hover { text-decoration: underline; }
.strength-bar { height: 4px; border-radius: 2px; background: var(--border); margin-top: 8px; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 2px; transition: width 0.3s, background 0.3s; width: 0; }

/* ===== DASHBOARD ===== */
.dashboard-layout { display: flex; min-height: 100vh; padding-top: 64px; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--bg-card);
  border-right: 1px solid var(--border); padding: 24px 16px;
  position: fixed; top: 64px; bottom: 0; overflow-y: auto;
}
.sidebar-nav { list-style: none; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
  color: var(--text); background: rgba(124,58,237,0.1);
}
.sidebar-nav li a.active { color: #a78bfa; }
.sidebar-section { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); padding: 16px 12px 8px; }
.dashboard-main { flex: 1; margin-left: 240px; padding: 32px; }
.dash-header { margin-bottom: 32px; }
.dash-header h1 { font-size: 1.6rem; margin-bottom: 4px; }
.dash-header p { font-size: 0.9rem; }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
.dash-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.dash-card-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; }
.dash-card-value { font-size: 2rem; font-weight: 700; }
.dash-card-change { font-size: 0.82rem; color: #86efac; margin-top: 4px; }
.dash-section-title { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.dash-api-key {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 20px;
}
.key-val {
  font-family: 'Courier New', monospace; font-size: 0.88rem;
  color: var(--text-muted); word-break: break-all;
}
.plan-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 100px; font-size: 0.8rem; font-weight: 600;
}
.plan-starter { background: rgba(124,58,237,0.15); color: #a78bfa; }
.plan-pro { background: rgba(59,130,246,0.15); color: #93c5fd; }
.plan-enterprise { background: rgba(234,179,8,0.15); color: #fde047; }

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite; display: none;
}
.spinner.visible { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== MOBILE NAV MENU ===== */
.nav-mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
  padding: 80px 24px 24px;
  flex-direction: column; gap: 8px;
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu a {
  padding: 14px 20px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 1rem; font-weight: 500;
  color: var(--text); display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .custom-inner { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  section { padding: 64px 0; }
  .nav-links, .nav-actions { display: none; }
  .nav-hamburger { display: block; }
  .steps { flex-direction: column; gap: 32px; }
  .steps::before { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .dashboard-main { margin-left: 0; padding: 16px; }
  .sidebar { display: none; }
  .hero-stats { gap: 28px; }
}
