/* ============================
   LegalClauze — Global Styles
   ============================ */

:root {
  --bg-dark: #0a0a1a;
  --bg-card: #12122a;
  --bg-surface: #1a1a3e;
  --gold: #d4af37;
  --gold-hover: #e6c54b;
  --gold-dim: rgba(212, 175, 55, 0.15);
  --text-primary: #f0f0f5;
  --text-secondary: #8888aa;
  --text-muted: #555577;
  --border: #2a2a4a;
  --green: #4ade80;
  --red: #ef4444;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }
img { max-width: 100%; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 15px;
  cursor: pointer; border: none; transition: all 0.2s;
}
.btn-primary { background: var(--gold); color: #0a0a1a; }
.btn-primary:hover { background: var(--gold-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 2px solid var(--gold); color: var(--gold); }
.btn-outline:hover { background: var(--gold-dim); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Navbar ---- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 60px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(10,10,26,0.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar.scrolled { height: 50px; }
.nav-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.logo-icon { font-size: 22px; }
.logo-text { font-size: 18px; font-weight: 800; color: var(--gold); letter-spacing: -0.5px; }
.nav-links { display: flex !important; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-links li { list-style: none; display: inline; }
.nav-links a { color: var(--text-secondary); font-weight: 500; font-size: 14px; transition: color 0.2s; white-space: nowrap; }
.nav-links a:hover { color: var(--gold); }
.nav-cta { display: flex !important; align-items: center; gap: 10px; }
.nav-cta .btn { padding: 8px 18px; font-size: 13px; white-space: nowrap; }
.mobile-toggle { display: none !important; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-toggle span { display: block; width: 24px; height: 2px; background: var(--text-primary); margin: 5px 0; transition: all 0.3s; }

/* ---- Hero ---- */
.hero {
  padding: 140px 40px 80px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.08) 0%, transparent 60%);
}
.hero h1 { font-size: 48px; font-weight: 800; line-height: 1.15; margin-bottom: 20px; letter-spacing: -1.5px; }
.hero h1 .gold { color: var(--gold); }
.hero p { font-size: 18px; color: var(--text-secondary); max-width: 580px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-badge { display: inline-block; margin-top: 24px; padding: 8px 20px; border-radius: 40px; background: var(--gold-dim); color: var(--gold); font-size: 14px; font-weight: 600; }

/* ---- How it works ---- */
.how-it-works { padding: 100px 40px; text-align: center; }
.section-title { font-size: 40px; font-weight: 800; margin-bottom: 16px; letter-spacing: -1px; }
.section-sub { color: var(--text-secondary); font-size: 18px; margin-bottom: 60px; }
.steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; max-width: 1000px; margin: 0 auto; }
.step-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 40px 30px; text-align: center; transition: all 0.3s;
}
.step-card:hover { border-color: var(--gold); transform: translateY(-4px); }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--gold); color: #0a0a1a; font-weight: 800; font-size: 20px; margin-bottom: 20px; }
.step-card h3 { font-size: 20px; margin-bottom: 10px; }
.step-card p { color: var(--text-secondary); font-size: 15px; }

/* ---- Pricing ---- */
.pricing { padding: 100px 40px; text-align: center; background: var(--bg-card); }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }
.pricing-card {
  background: var(--bg-dark); border: 1px solid var(--border); border-radius: 16px;
  padding: 36px 28px; text-align: center; transition: all 0.3s; position: relative;
}
.pricing-card:hover { border-color: var(--gold); transform: translateY(-4px); background: var(--bg-surface); }
.pricing-card.featured { border-color: var(--gold); }
.pricing-card.featured::before {
  content: "MOST POPULAR"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #0a0a1a; padding: 4px 16px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
}
.pricing-card h3 { font-size: 22px; margin-bottom: 8px; }
.pricing-price { font-size: 42px; font-weight: 800; color: var(--gold); margin: 16px 0; }
.pricing-price span { font-size: 16px; color: var(--text-secondary); font-weight: 400; }
.pricing-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 28px; }
.pricing-features li { padding: 8px 0; color: var(--text-secondary); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pricing-features li::before { content: "\2713"; color: var(--gold); font-weight: 700; }

/* ---- Doc Types ---- */
.doc-types { padding: 100px 40px; text-align: center; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; max-width: 1000px; margin: 0 auto; }
.doc-tag {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; font-size: 14px; font-weight: 500; transition: all 0.2s;
}
.doc-tag:hover { border-color: var(--gold); color: var(--gold); }

/* ---- CTA ---- */
.cta-section {
  padding: 100px 40px; text-align: center;
  background: radial-gradient(ellipse at 50% 100%, rgba(212,175,55,0.08) 0%, transparent 60%);
}
.cta-section h2 { font-size: 40px; font-weight: 800; margin-bottom: 16px; }
.cta-section p { color: var(--text-secondary); font-size: 18px; margin-bottom: 32px; }

/* ---- Footer ---- */
.footer { padding: 40px; border-top: 1px solid var(--border); text-align: center; }
.footer p { color: var(--text-muted); font-size: 13px; }

/* ---- Auth Pages ---- */
.auth-page { display: flex; min-height: 100vh; }
.auth-container { display: flex; width: 100%; min-height: 100vh; }
.auth-left {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 100%);
  padding: 40px;
}
.auth-brand h1 { font-size: 32px; font-weight: 800; margin: 20px 0 10px; }
.auth-brand p { color: var(--text-secondary); font-size: 16px; }
.auth-benefits { list-style: none; margin-top: 24px; }
.auth-benefits li { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text-secondary); }
.auth-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg-card); }
.auth-form-container { width: 100%; max-width: 420px; }
.auth-form-container h2 { font-size: 28px; font-weight: 700; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-group input, .form-group textarea, .form-group select {
  padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-dark); color: var(--text-primary); font-size: 15px;
  font-family: var(--font); transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--gold); outline: none; }
.form-error { color: var(--red); font-size: 13px; }
.form-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-link { color: var(--gold); font-size: 13px; }
.form-row { display: flex; justify-content: space-between; align-items: center; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.auth-switch { text-align: center; margin-top: 20px; color: var(--text-secondary); font-size: 14px; }

/* ---- Dashboard ---- */
.dashboard-page { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; min-height: 100vh; background: var(--bg-card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
}
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 8px;
  color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all 0.2s; text-decoration: none;
}
.sidebar-link:hover { background: var(--bg-surface); color: var(--text-primary); }
.sidebar-link.active { background: var(--gold-dim); color: var(--gold); }
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); }
.dashboard-main { flex: 1; margin-left: 260px; padding: 0; min-height: 100vh; }
.dashboard-header {
  padding: 20px 32px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.dashboard-title { font-size: 22px; font-weight: 700; }
.dashboard-user { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--text-secondary); font-size: 14px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg-surface); border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: var(--gold);
}
.tab-content { display: none; padding: 32px; }
.tab-content.active { display: block; }

/* ---- Cards ---- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 24px; }

/* ---- Stat Cards ---- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; }
.stat-card-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card-value { font-size: 32px; font-weight: 800; }
.stat-card-value.gold { color: var(--gold); }

/* ---- Badges ---- */
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-gold { background: var(--gold-dim); color: var(--gold); }
.badge-green { background: rgba(74,222,128,0.15); color: var(--green); }

/* ---- Generate Box ---- */
.generate-box { max-width: 700px; margin: 0 auto; }
.generate-box textarea {
  width: 100%; min-height: 140px; padding: 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-dark); color: var(--text-primary); font-size: 15px; font-family: var(--font);
  resize: vertical; transition: border-color 0.2s;
}
.generate-box textarea:focus { border-color: var(--gold); outline: none; }
.generate-box textarea::placeholder { color: var(--text-muted); }
.generate-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.generate-actions select {
  padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-dark); color: var(--text-primary); font-size: 14px;
}

/* ---- Document display ---- */
.doc-display {
  background: var(--bg-dark); border: 1px solid var(--border); border-radius: 12px;
  padding: 32px; margin-top: 24px; white-space: pre-wrap; font-size: 14px; line-height: 1.8;
  max-height: 600px; overflow-y: auto;
}
.doc-display.preview { opacity: 0.7; }

/* ---- Document list ---- */
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-dark); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; transition: all 0.2s;
}
.doc-item:hover { border-color: var(--gold); }
.doc-item-info h4 { font-size: 15px; margin-bottom: 4px; }
.doc-item-info p { font-size: 13px; color: var(--text-secondary); }
.doc-item-actions { display: flex; gap: 8px; }

/* ---- Responsive ---- */
@media (max-width: 680px) {
  .nav-links, .nav-cta { display: none !important; }
  .nav-links.show, .nav-cta.show { display: flex !important; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg-dark); padding: 20px; border-bottom: 1px solid var(--border); }
  .mobile-toggle { display: block !important; }
}
@media (max-width: 768px) {
  .navbar { padding: 10px 16px; }
  .hero { padding: 120px 20px 60px; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 16px; }
  .steps-row { grid-template-columns: 1fr; gap: 20px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .auth-container { flex-direction: column; }
  .auth-left { padding: 30px 20px; min-height: auto; }
  .auth-right { padding: 30px 20px; }
  .form-row-2col { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .dashboard-main { margin-left: 0; }
  .dashboard-header .sidebar-toggle { display: block; }
  .tab-content { padding: 20px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .section-title { font-size: 28px; }
  .doc-grid { grid-template-columns: 1fr 1fr; }
}
