* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --surface: #111;
  --border: #222;
  --text: #e0e0e0;
  --text-dim: #888;
  --accent: #4fc3f7;
  --accent-hover: #81d4fa;
  --error: #ef5350;
  --success: #66bb6a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Nav */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

#nav-right { display: flex; align-items: center; gap: 1rem; }
#nav-right button { background: none; border: 1px solid var(--border); color: var(--text); padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
#nav-right button:hover { border-color: var(--accent); color: var(--accent); }
#nav-right .user-email { color: var(--text-dim); font-size: 0.85rem; }
#nav-right .tier-badge { background: var(--accent); color: #000; padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }

/* Hero */
#hero {
  max-width: 700px;
  margin: 0 auto;
  padding: 4rem 2rem 3rem;
  text-align: center;
}

h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.8rem;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

#analyze-box {
  display: flex;
  gap: 0;
  max-width: 560px;
  margin: 0 auto 0.5rem;
}

#repo-url {
  flex: 1;
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: var(--text);
  outline: none;
}

#repo-url:focus { border-color: var(--accent); }

#analyze-btn {
  padding: 0.9rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  white-space: nowrap;
}

#analyze-btn:hover { background: var(--accent-hover); }
#analyze-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.error { color: var(--error); font-size: 0.85rem; margin-top: 0.5rem; }
.hint { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.3rem; }

/* Results */
#result-area {
  text-align: left;
  margin-top: 2rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

#result-status { color: var(--accent); margin-bottom: 1rem; font-weight: 500; }

.content h1 { font-size: 1.6rem; margin: 1.5rem 0 0.8rem; color: #fff; }
.content h2 { font-size: 1.3rem; margin: 1.5rem 0 0.6rem; color: var(--accent); }
.content h3 { font-size: 1.05rem; margin: 1rem 0 0.5rem; color: #ccc; }
.content p { margin-bottom: 0.8rem; }
.content ul, .content ol { margin: 0 0 1rem 1.5rem; }
.content li { margin-bottom: 0.25rem; }
.content code { background: #1a1a2e; padding: 0.15em 0.4em; border-radius: 3px; font-size: 0.9em; color: var(--accent); }
.content pre { background: #1a1a2e; padding: 1rem; border-radius: 6px; overflow-x: auto; margin-bottom: 1rem; }
.content pre code { background: none; padding: 0; color: var(--text); }
.content strong { color: #fff; }
.content a { color: var(--accent); }

#result-actions { margin-top: 1.5rem; display: flex; gap: 1rem; }

/* How it works */
#how-it-works {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}

#how-it-works h2 { text-align: center; font-size: 1.6rem; color: #fff; margin-bottom: 2rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

.step { text-align: center; }
.step-num { width: 40px; height: 40px; line-height: 40px; background: var(--accent); color: #000; border-radius: 50%; font-weight: 700; margin: 0 auto 1rem; }
.step h3 { color: #fff; margin-bottom: 0.5rem; }
.step p { color: var(--text-dim); font-size: 0.95rem; }

/* Pricing */
#pricing {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}

#pricing h2 { text-align: center; font-size: 1.6rem; color: #fff; margin-bottom: 2rem; }

.pricing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.pricing-card.featured { border-color: var(--accent); }

.pricing-card h3 { font-size: 1.2rem; color: #fff; margin-bottom: 0.5rem; }
.pricing-card .price { font-size: 2.5rem; font-weight: 700; color: #fff; margin-bottom: 1rem; }
.pricing-card .price span { font-size: 1rem; color: var(--text-dim); font-weight: 400; }
.pricing-card ul { list-style: none; margin-bottom: 1.5rem; }
.pricing-card li { padding: 0.3rem 0; color: var(--text-dim); }
.pricing-card li::before { content: '\2713 '; color: var(--success); }

.btn-primary {
  display: inline-block;
  padding: 0.7rem 2rem;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  margin-bottom: 0.5rem;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: none;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
}

.btn-secondary:hover { background: rgba(79, 195, 247, 0.1); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-content h2 { color: #fff; margin-bottom: 1.2rem; }

.modal-content input {
  width: 100%;
  padding: 0.7rem 1rem;
  margin-bottom: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.modal-content input:focus { border-color: var(--accent); }

.auth-switch { margin-top: 1rem; color: var(--text-dim); font-size: 0.9rem; text-align: center; }
.auth-switch a { color: var(--accent); text-decoration: none; }

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}

footer a { color: var(--accent); text-decoration: none; }

/* Responsive */
@media (max-width: 600px) {
  h1 { font-size: 1.8rem; }
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .pricing-cards { grid-template-columns: 1fr; }
  #analyze-box { flex-direction: column; }
  #repo-url { border-radius: 8px; border-right: 1px solid var(--border); }
  #analyze-btn { border-radius: 8px; }
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }
