:root {
  --bg: #060a14; --surface: #0d1526; --surface2: #121d33; --surface3: #1a2640;
  --accent: #00c9ff; --accent2: #7c5cfc; --green: #10b981; --orange: #f59e0b;
  --red: #ef4444; --text: #e2e8f0; --muted: #64748b; --border: rgba(255,255,255,0.07);
  --card-bg: #0d1526;
}

/* LIGHT MODE */
body.light-mode {
  --bg: #f0f4f8; --surface: #ffffff; --surface2: #e8edf2; --surface3: #d1dbe6;
  --text: #0f172a; --muted: #64748b; --border: rgba(0,0,0,0.08); --card-bg: #ffffff;
}
body.light-mode nav { background: rgba(240,244,248,0.92); }
body.light-mode .nav-links a:hover { background: rgba(0,0,0,0.05); }
body.light-mode .issue-item { background: rgba(0,0,0,0.02); }
body.light-mode .issue-row { background: rgba(0,0,0,0.02); }
body.light-mode .rec-item { background: rgba(0,0,0,0.02); }
body.light-mode .mockup-card { box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
body.light-mode .spinner { border-color: #d1dbe6; border-top-color: var(--accent); }

/* THEME TOGGLE BUTTON */
.theme-toggle { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface2); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; transition: all 0.2s; flex-shrink: 0; }
.theme-toggle:hover { background: var(--surface3); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; min-height: 100vh; overflow-x: hidden; line-height: 1.6; }

/* NAV - Modern Professional Design */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 20px 64px; background: rgba(6,10,20,0.92); backdrop-filter: blur(24px) saturate(180%); border-bottom: 1px solid var(--border); box-shadow: 0 4px 24px rgba(0,0,0,0.12); }
.nav-logo { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.3rem; display: flex; align-items: center; gap: 12px; cursor: pointer; letter-spacing: -0.02em; transition: opacity 0.3s ease; }
.nav-logo:hover { opacity: 0.85; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 0 16px rgba(0,201,255,0.5), 0 0 32px rgba(124,92,252,0.3); animation: pulse-glow 3s ease infinite; }
@keyframes pulse-glow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.8; } }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.925rem; font-weight: 500; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); padding: 10px 18px; border-radius: 8px; position: relative; letter-spacing: -0.01em; }
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--accent); background: rgba(0,201,255,0.08); font-weight: 600; }
.nav-cta { background: linear-gradient(135deg, var(--accent), #00b8e6); color: #000; border: none; padding: 11px 24px; border-radius: 10px; font-weight: 600; font-size: 0.9rem; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.3s ease; box-shadow: 0 4px 16px rgba(0,201,255,0.25); letter-spacing: -0.01em; }
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,201,255,0.4); background: linear-gradient(135deg, #00d4ff, var(--accent)); }

/* User Profile Section */
.nav-user { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 0.9rem; color: #000; letter-spacing: 0; box-shadow: 0 0 0 2px rgba(0,201,255,0.2); transition: all 0.3s ease; }
.user-avatar:hover { transform: scale(1.05); box-shadow: 0 0 0 2px rgba(0,201,255,0.4), 0 4px 12px rgba(0,201,255,0.2); }
.user-info { display: flex; flex-direction: column; align-items: flex-start; }
.user-greeting { font-size: 0.75rem; color: var(--muted); font-weight: 400; letter-spacing: -0.01em; }
.user-name { font-size: 0.9rem; color: var(--text); font-weight: 600; letter-spacing: -0.01em; margin-top: -2px; }

/* PAGES */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }
#page-auth { align-items: center; justify-content: center; min-height: 100vh; padding: 100px 24px 60px; background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(124,92,252,0.1) 0%, transparent 60%), var(--bg); }
#page-auth.active { display: flex; }
#page-landing { background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0,201,255,0.12) 0%, transparent 60%), var(--bg); }

/* BUTTONS */
.btn-primary { background: var(--accent); color: #000; border: none; padding: 14px 28px; border-radius: 10px; font-weight: 700; font-size: 0.95rem; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.2s; box-shadow: 0 0 24px rgba(0,201,255,0.2); text-decoration: none; display: inline-block; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(0,201,255,0.4); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); padding: 14px 28px; border-radius: 10px; font-weight: 500; font-size: 0.95rem; cursor: pointer; font-family: 'Inter', sans-serif; }
.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); padding: 10px 20px; border-radius: 9px; font-weight: 600; font-size: 0.88rem; cursor: pointer; font-family: 'Inter', sans-serif; text-decoration: none; display: inline-block; transition: background 0.2s; }
.btn-outline:hover { background: rgba(0,201,255,0.08); }
.btn-full { width: 100%; background: var(--accent); color: #000; border: none; padding: 14px; border-radius: 10px; font-weight: 700; font-size: 0.95rem; cursor: pointer; font-family: 'Inter', sans-serif; margin-top: 8px; }

/* HERO */
.hero { padding: 160px 48px 100px; max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,201,255,0.1); border: 1px solid rgba(0,201,255,0.2); padding: 6px 14px; border-radius: 100px; font-size: 0.8rem; color: var(--accent); font-weight: 500; margin-bottom: 24px; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.hero h1 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(2.4rem, 4.5vw, 4rem); font-weight: 700; line-height: 1.15; margin-bottom: 24px; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; }
.hero p { color: var(--muted); font-size: 1.1rem; line-height: 1.7; margin-bottom: 36px; font-weight: 400; letter-spacing: -0.01em; max-width: 540px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* MOCKUP */
.mockup-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: 0 32px 80px rgba(0,0,0,0.5); }
.mockup-card .card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; font-size: 1rem; letter-spacing: -0.015em; }
.status-badge { font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 100px; background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.issue-list { display: flex; flex-direction: column; gap: 10px; }
.issue-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); }
.issue-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; flex-shrink: 0; }
.issue-icon.red { background: rgba(239,68,68,0.15); color: var(--red); }
.issue-icon.orange { background: rgba(245,158,11,0.15); color: var(--orange); }
.issue-icon.green { background: rgba(16,185,129,0.15); color: var(--green); }
.issue-text { font-size: 0.82rem; }
.issue-text strong { display: block; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.issue-text span { color: var(--muted); font-size: 0.78rem; }
.score-bar-wrap { margin-top: 14px; }
.score-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.score-bar { height: 6px; background: var(--surface3); border-radius: 100px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 100px; }

/* STATS */
.stats-bar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 48px; display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; max-width: 1200px; margin: 0 auto 80px; }
.stat { text-align: center; }
.stat-num { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 2.4rem; color: var(--accent); display: block; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 0.875rem; font-weight: 400; letter-spacing: -0.01em; }

/* FEATURES */
.features { padding: 80px 48px; max-width: 1200px; margin: 0 auto; }
.section-label { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.section-title { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: clamp(2rem, 3vw, 2.75rem); margin-bottom: 16px; letter-spacing: -0.025em; line-height: 1.2; }
.section-sub { color: var(--muted); font-size: 1.05rem; max-width: 580px; margin-bottom: 48px; line-height: 1.65; letter-spacing: -0.01em; font-weight: 400; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px; transition: border-color 0.2s, transform 0.2s; }
.feature-card:hover { border-color: rgba(0,201,255,0.2); transform: translateY(-3px); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 16px; background: rgba(0,201,255,0.1); color: var(--accent); }
.feature-card h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; font-size: 1.05rem; margin-bottom: 10px; letter-spacing: -0.015em; }
.feature-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.65; letter-spacing: -0.01em; font-weight: 400; }

/* CTA & FOOTER */
.cta-section { padding: 80px 48px; max-width: 760px; margin: 0 auto; text-align: center; }
.cta-section h2 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom: 16px; letter-spacing: -0.025em; line-height: 1.2; }
.cta-section p { color: var(--muted); font-size: 0.97rem; margin-bottom: 32px; }
footer { border-top: 1px solid var(--border); padding: 32px 48px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 0.82rem; }

/* AUTH BOX */
.auth-box { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 40px; }
.auth-logo { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.5rem; text-align: center; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 10px; letter-spacing: -0.02em; }
.auth-sub { color: var(--muted); font-size: 0.87rem; text-align: center; margin-bottom: 28px; }
.tabs { display: flex; background: var(--surface2); border-radius: 10px; padding: 4px; margin-bottom: 28px; }
.tab { flex: 1; text-align: center; padding: 9px; border-radius: 8px; font-size: 0.88rem; font-weight: 500; cursor: pointer; color: var(--muted); transition: all 0.2s; }
.tab.active { background: var(--accent); color: #000; font-weight: 700; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 500; margin-bottom: 7px; }
.form-group input, .form-group select { width: 100%; padding: 12px 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 0.92rem; outline: none; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus { border-color: rgba(0,201,255,0.4); }
.form-group input::placeholder { color: var(--muted); }
.form-group select option { background: var(--surface2); }
.auth-footer { text-align: center; margin-top: 18px; font-size: 0.82rem; color: var(--muted); }
.auth-footer a { color: var(--accent); text-decoration: none; }

/* ANALYZER */
.analyzer-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 36px; }
.textarea-plan { width: 100%; min-height: 180px; padding: 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 0.92rem; outline: none; resize: vertical; line-height: 1.6; }
.textarea-plan:focus { border-color: rgba(0,201,255,0.4); }
.textarea-plan::placeholder { color: var(--muted); }
.analyze-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.option-check { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--border); cursor: pointer; font-size: 0.88rem; font-weight: 500; }
.option-check.selected { border-color: rgba(0,201,255,0.4); background: rgba(0,201,255,0.07); }
.check-icon { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; flex-shrink: 0; }
.option-check.selected .check-icon { background: var(--accent); border-color: var(--accent); color: #000; }
.analyzing-overlay { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 56px 24px; text-align: center; }
.analyzing-overlay.show { display: flex; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--surface3); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-thinking { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 340px; }
.ai-thinking-line { height: 11px; border-radius: 6px; background: var(--surface3); animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0%,100%{opacity:0.4} 50%{opacity:0.85} }

/* DASHBOARD */
.welcome-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.welcome-bar h2 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.75rem; letter-spacing: -0.02em; }
.score-overview { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.score-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.sc-label { font-size: 0.8rem; color: var(--muted); font-weight: 500; margin-bottom: 10px; letter-spacing: -0.01em; }
.sc-val { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 2.1rem; letter-spacing: -0.02em; }
.sc-val.good { color: var(--green); } .sc-val.warn { color: var(--orange); } .sc-val.bad { color: var(--red); } .sc-val.neutral { color: var(--accent); }
.sc-sub { font-size: 0.74rem; color: var(--muted); margin-top: 4px; }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.dash-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.panel-title { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; font-size: 1rem; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; letter-spacing: -0.015em; }
.badge { font-size: 0.7rem; padding: 3px 10px; border-radius: 100px; background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); font-weight: 600; }
.badge.ok { background: rgba(16,185,129,0.15); color: var(--green); border-color: rgba(16,185,129,0.3); }
.issue-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 12px; margin-bottom: 10px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); }
.issue-row:last-child { margin-bottom: 0; }
.sev-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.sev-dot.high { background: var(--red); box-shadow: 0 0 6px var(--red); }
.sev-dot.med { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.sev-dot.low { background: var(--green); box-shadow: 0 0 6px var(--green); }
.issue-row-content h4 { font-size: 0.88rem; font-weight: 600; margin-bottom: 3px; }
.issue-row-content p { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
.tag { display: inline-block; margin-top: 6px; font-size: 0.68rem; padding: 2px 8px; border-radius: 100px; background: rgba(124,92,252,0.15); color: var(--accent2); border: 1px solid rgba(124,92,252,0.25); font-weight: 600; }
.area-bars { display: flex; flex-direction: column; gap: 14px; }
.area-bar-label { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 6px; }
.area-bar-track { height: 7px; background: var(--surface3); border-radius: 100px; overflow: hidden; }
.area-bar-fill { height: 100%; border-radius: 100px; }
.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); }
.rec-num { width: 26px; height: 26px; border-radius: 8px; background: rgba(0,201,255,0.1); color: var(--accent); font-size: 0.75rem; font-weight: 700; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk', 'Inter', sans-serif; }
.rec-text h4 { font-size: 0.86rem; font-weight: 600; margin-bottom: 3px; }
.rec-text p { font-size: 0.77rem; color: var(--muted); line-height: 1.5; }

/* MISC */
.hidden { display: none !important; }
.msg { padding: 12px 16px; border-radius: 10px; font-size: 0.88rem; margin-bottom: 16px; }
.msg.error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.msg.success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: var(--green); }

@media (max-width: 900px) {
  nav { padding: 16px 24px; }
  .nav-links { display: none; }
  .nav-user { gap: 8px; }
  .user-info { display: none; }
  .user-avatar { width: 32px; height: 32px; font-size: 0.8rem; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 110px 24px 60px; }
  .features-grid { grid-template-columns: 1fr; }
  .score-overview { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr 1fr; padding: 32px 24px; }
  .analyze-options { grid-template-columns: 1fr; }
}
