:root {
  --primary: #1e293b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --warning: #f59e0b;
  --success: #16a34a;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.btn { display: inline-flex; align-items: 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(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }

/* Nav */
nav { background: var(--primary); color: #fff; padding: 16px 0; }
nav .container { display: flex; justify-content: space-between; align-items: center; }
nav .logo { font-size: 20px; font-weight: 700; color: #fff; }
nav .logo span { color: #60a5fa; }
nav .nav-links { display: flex; gap: 24px; align-items: center; }
nav .nav-links a { color: #cbd5e1; font-size: 14px; }
nav .nav-links a:hover { color: #fff; text-decoration: none; }

/* Hero */
.hero { padding: 80px 0; text-align: center; background: linear-gradient(135deg, #1e293b 0%, #334155 100%); color: #fff; }
.hero h1 { font-size: 48px; font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.hero p { font-size: 20px; color: #94a3b8; max-width: 600px; margin: 0 auto 32px; }
@media (max-width: 768px) { .hero h1 { font-size: 32px; } .hero p { font-size: 16px; } }

/* Sections */
.section { padding: 64px 0; }
.section-title { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 48px; }

/* Pain Points */
.pain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.pain-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 32px; text-align: center; }
.pain-card .icon { font-size: 40px; margin-bottom: 16px; }
.pain-card h3 { font-size: 18px; margin-bottom: 8px; }
.pain-card p { color: var(--muted); font-size: 14px; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.step { text-align: center; }
.step .num { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; margin-bottom: 16px; }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 14px; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 960px; margin: 0 auto; }
.price-card { background: var(--card); border: 2px solid var(--border); border-radius: 16px; padding: 32px; text-align: center; position: relative; }
.price-card.popular { border-color: var(--accent); }
.price-card.popular::before { content: 'Most Popular'; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 4px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.price-card h3 { font-size: 24px; margin-bottom: 8px; }
.price-card .price { font-size: 48px; font-weight: 800; margin: 16px 0; }
.price-card .price span { font-size: 16px; font-weight: 400; color: var(--muted); }
.price-card ul { list-style: none; margin: 24px 0; text-align: left; }
.price-card ul li { padding: 8px 0; font-size: 14px; color: var(--muted); }
.price-card ul li::before { content: '✓'; color: var(--success); font-weight: 700; margin-right: 8px; }

/* FAQ */
.faq { max-width: 720px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item h3 { font-size: 16px; margin-bottom: 8px; cursor: pointer; }
.faq-item p { color: var(--muted); font-size: 14px; }

/* Footer */
footer { background: var(--primary); color: #94a3b8; padding: 32px 0; text-align: center; font-size: 14px; }

/* Disclaimer */
.disclaimer { background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px; padding: 12px 16px; font-size: 13px; color: #92400e; margin: 16px 0; }

/* App styles */
.app-layout { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 64px); }
@media (max-width: 900px) { .app-layout { grid-template-columns: 1fr; } .sidebar { display: none; } }
.sidebar { background: #fff; border-right: 1px solid var(--border); padding: 24px; overflow-y: auto; }
.sidebar h3 { font-size: 14px; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; letter-spacing: 0.05em; }
.history-item { padding: 12px; border-radius: 8px; cursor: pointer; margin-bottom: 8px; border: 1px solid var(--border); }
.history-item:hover { background: #f1f5f9; }
.history-item .score { font-weight: 700; font-size: 14px; }
.history-item .date { font-size: 12px; color: var(--muted); }
.history-item .preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-content { padding: 32px; max-width: 900px; }
.review-input { width: 100%; min-height: 250px; padding: 16px; border: 2px solid var(--border); border-radius: 12px; font-family: inherit; font-size: 14px; resize: vertical; }
.review-input:focus { outline: none; border-color: var(--accent); }
.char-count { text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Risk gauge */
.risk-gauge { text-align: center; margin: 24px 0; }
.risk-score { font-size: 72px; font-weight: 800; line-height: 1; }
.risk-score.low { color: var(--success); }
.risk-score.medium { color: var(--warning); }
.risk-score.high { color: var(--danger); }
.risk-label { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* Results */
.results-section { margin-top: 32px; }
.results-section h2 { font-size: 20px; margin-bottom: 16px; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.clause-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 12px; border-left: 4px solid var(--border); }
.clause-card.high { border-left-color: var(--danger); }
.clause-card.medium { border-left-color: var(--warning); }
.clause-card.low { border-left-color: var(--success); }
.clause-card .risk-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.clause-card .risk-badge.high { background: #fef2f2; color: var(--danger); }
.clause-card .risk-badge.medium { background: #fffbeb; color: #b45309; }
.clause-card .risk-badge.low { background: #f0fdf4; color: var(--success); }
.clause-card .clause-text { font-style: italic; color: var(--muted); margin: 8px 0; font-size: 13px; border-left: 2px solid var(--border); padding-left: 12px; }
.clause-card .explanation { font-size: 14px; }

.protection-list, .rec-list { list-style: none; }
.protection-list li, .rec-list li { padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.protection-list li::before { content: '⚠️'; margin-right: 8px; }
.rec-list li::before { content: '💡'; margin-right: 8px; }

/* Loading */
.loading { text-align: center; padding: 48px; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top: 4px solid var(--accent); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* User menu */
.user-menu { position: relative; }
.user-btn { background: #334155; color: #fff; padding: 8px 16px; border-radius: 8px; cursor: pointer; border: none; font-size: 13px; }
.user-dropdown { position: absolute; right: 0; top: 100%; margin-top: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; min-width: 200px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: none; z-index: 100; }
.user-dropdown.show { display: block; }
.user-dropdown a, .user-dropdown button { display: block; width: 100%; text-align: left; padding: 10px 16px; font-size: 14px; color: var(--text); background: none; border: none; cursor: pointer; }
.user-dropdown a:hover, .user-dropdown button:hover { background: #f1f5f9; text-decoration: none; }

/* Login */
.login-box { max-width: 420px; margin: 80px auto; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 48px; text-align: center; }
.login-box h1 { font-size: 24px; margin-bottom: 8px; }
.login-box p { color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.login-box input { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: 8px; font-size: 15px; margin-bottom: 16px; }
.login-box input:focus { outline: none; border-color: var(--accent); }
