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

:root {
  --primary: #0066ff;
  --primary-dark: #0052cc;
  --secondary: #667eea;
  --accent: #ff6b6b;
  --bg: #fafafa;
  --bg-dark: #f5f5f5;
  --text: #1a1a1a;
  --text-light: #666;
  --border: #e0e0e0;
  --success: #31a24c;
  --warning: #ff9500;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  sticky: top;
  top: 0;
  z-index: 100;
  padding: 20px 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-info {
  color: var(--text-light);
  margin-right: 16px;
  font-size: 14px;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--bg-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #5568d3;
}

.btn-large {
  padding: 16px 40px;
  font-size: 18px;
}

.back-btn {
  margin-top: 20px;
  width: 100%;
}

/* Pages */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Landing Page */
.hero {
  padding: 100px 0;
  text-align: center;
  background: linear-gradient(135deg, #0066ff 0%, #667eea 100%);
  color: white;
  margin-top: -60px;
  padding-top: 160px;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 16px;
  font-weight: 700;
}

.hero p {
  font-size: 20px;
  opacity: 0.95;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero .btn {
  margin-top: 20px;
}

.features {
  padding: 80px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.feature {
  text-align: center;
}

.feature h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.feature p {
  color: var(--text-light);
}

.pricing {
  padding: 80px 0;
  background: white;
  text-align: center;
}

.pricing h2 {
  font-size: 36px;
  margin-bottom: 60px;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.pricing-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.pricing-card.featured {
  border: 2px solid var(--primary);
  transform: scale(1.05);
}

.pricing-card h3 {
  font-size: 24px;
  margin-bottom: 16px;
}

.pricing-card .price {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
}

.pricing-card .price span {
  font-size: 18px;
  color: var(--text-light);
}

.pricing-card ul {
  list-style: none;
  margin: 32px 0;
  text-align: left;
}

.pricing-card li {
  padding: 12px 0;
  color: var(--text-light);
}

.pricing-card .btn {
  width: 100%;
  margin-top: 20px;
}

/* Auth Pages */
#auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0066ff 0%, #667eea 100%);
}

.auth-page {
  width: 100%;
  height: 100%;
}

.auth-container {
  max-width: 400px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.auth-container h2 {
  margin-bottom: 32px;
  font-size: 28px;
  text-align: center;
}

.auth-container form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-container input {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
}

.auth-container input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}

.auth-link {
  text-align: center;
  color: var(--text-light);
  margin-top: 16px;
}

.auth-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* Dashboard */
.dashboard-container {
  padding: 40px 0;
}

.analysis-form-section {
  background: white;
  padding: 40px;
  border-radius: 12px;
  margin-bottom: 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.analysis-form-section h2 {
  margin-bottom: 24px;
}

#tech-stack-input {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
}

#tech-stack-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}

.analysis-form-section .btn {
  margin-top: 16px;
  width: 100%;
}

.warning {
  margin-top: 16px;
  padding: 12px;
  background: #fff3cd;
  border-left: 4px solid var(--warning);
  color: #856404;
  border-radius: 4px;
}

.warning a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.analysis-results-section {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 40px;
}

.analysis-results-section h2 {
  margin-bottom: 24px;
}

.analysis-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analysis-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  background: var(--bg-dark);
}

.analysis-item h3 {
  margin-bottom: 12px;
  color: var(--text);
}

.analysis-item .date {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 16px;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 16px 0;
}

.score-item {
  background: white;
  padding: 16px;
  border-radius: 6px;
}

.score-label {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 8px;
}

.score-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.analysis-result {
  background: white;
  padding: 16px;
  border-radius: 6px;
  margin-top: 16px;
  color: var(--text-light);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

.loading-msg {
  text-align: center;
  color: var(--text-light);
  padding: 40px;
}

.agent-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px;
  border-radius: 12px;
  color: white;
}

.agent-section h2 {
  margin-bottom: 24px;
  color: white;
}

.agent-status {
  background: rgba(255,255,255,0.1);
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.agent-status p {
  margin-bottom: 12px;
}

.agent-section .btn {
  background: white;
  color: var(--primary);
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spinner {
  border: 4px solid rgba(255,255,255,0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 16px;
  }

  .pricing-card.featured {
    transform: scale(1);
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  .navbar .container {
    flex-direction: column;
    gap: 16px;
  }

  .nav-buttons {
    width: 100%;
  }

  .auth-container {
    margin: 40px 20px;
  }
}
