/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #F8FAFC;
  color: #1E293B;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #4A5D23;
  text-decoration: none;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-links a, .nav-links button {
  text-decoration: none;
  color: #64748B;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #0F172A;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: #6366F1;
  color: white !important;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1rem;
}

.btn-primary:hover {
  background: #4F46E5;
}

.btn-secondary {
  display: inline-block;
  background: #E2E8F0;
  color: #475569 !important;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1rem;
}

.btn-secondary:hover {
  background: #CBD5E1;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.1rem;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 60px 20px;
}

.hero h1 {
  font-size: 2.8rem;
  color: #0F172A;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #64748B;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-cta {
  margin-top: 24px;
}

.hero-note {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #94A3B8;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin: 60px 0;
}

.feature-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  margin-bottom: 8px;
  color: #0F172A;
}

.feature-card p {
  color: #64748B;
}

/* How It Works */
.how-it-works {
  text-align: center;
  margin: 60px 0;
}

.how-it-works h2 {
  margin-bottom: 40px;
  color: #0F172A;
}

.steps {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.step {
  text-align: center;
  max-width: 200px;
}

.step-number {
  width: 50px;
  height: 50px;
  background: #6366F1;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.step h4 {
  margin-bottom: 8px;
  color: #0F172A;
}

.step p {
  color: #64748B;
  font-size: 0.9rem;
}

/* Disclaimer Section */
.disclaimer {
  margin: 40px 0;
}

.disclaimer-card {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.disclaimer-card h3 {
  color: #92400E;
  margin-bottom: 12px;
}

.disclaimer-card p {
  color: #78350F;
  margin-bottom: 8px;
}

.disclaimer-card p:last-child {
  margin-bottom: 0;
}

.disclaimer-card a {
  color: #6366F1;
  font-weight: 600;
}

/* CTA Section */
.cta-section {
  text-align: center;
  background: #0F172A;
  color: white;
  padding: 60px 20px;
  border-radius: 16px;
  margin: 60px 0;
}

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

/* Card */
.card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.card h2 {
  margin-bottom: 16px;
  font-size: 1.3rem;
}

/* Text Input */
textarea {
  width: 100%;
  height: 180px;
  padding: 16px;
  border: 2px solid #E2E8F0;
  border-radius: 8px;
  font-size: 1rem;
  resize: vertical;
  font-family: inherit;
}

textarea:focus {
  outline: none;
  border-color: #6366F1;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

#charCount {
  color: #94A3B8;
  font-size: 0.9rem;
}

/* Results */
.result-bar {
  height: 24px;
  background: #10B981;
  border-radius: 12px;
  overflow: hidden;
  margin: 20px 0 8px;
}

.ai-portion {
  height: 100%;
  background: #EF4444;
  width: 0%;
  transition: width 0.5s ease;
}

.result-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #64748B;
}

.percentage {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 16px;
  color: #0F172A;
}

.reason {
  text-align: center;
  color: #64748B;
  margin-top: 8px;
  font-style: italic;
}

/* Loading */
#loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #E2E8F0;
  border-top-color: #6366F1;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

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

/* User Bar */
.user-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #FFFFFF;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#userEmail {
  color: #64748B;
}

.usage-badge {
  background: #E0E7FF;
  color: #4F46E5;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.plan-badge {
  background: #F1F5F9;
  color: #64748B;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: auto;
}

.plan-badge.pro {
  background: #DCFCE7;
  color: #16A34A;
}

/* History */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #E2E8F0;
}

.history-item:last-child {
  border-bottom: none;
}

.history-text {
  color: #64748B;
  font-size: 0.9rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 16px;
}

.history-score {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 20px;
}

.history-score.high {
  background: #FEE2E2;
  color: #DC2626;
}

.history-score.medium {
  background: #FEF3C7;
  color: #D97706;
}

.history-score.low {
  background: #DCFCE7;
  color: #16A34A;
}

.empty-state {
  text-align: center;
  color: #94A3B8;
  padding: 20px;
}

/* Auth Pages */
.auth-section {
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}

.auth-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  color: #64748B;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #374151;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E2E8F0;
  border-radius: 8px;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: #6366F1;
}

.error-message {
  color: #DC2626;
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-align: center;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: #64748B;
}

.auth-footer a {
  color: #6366F1;
  text-decoration: none;
  font-weight: 600;
}

/* Pricing */
.pricing-header {
  text-align: center;
  padding: 40px 20px;
}

.pricing-header h1 {
  margin-bottom: 8px;
}

.pricing-header p {
  color: #64748B;
}

.pricing {
  margin: 40px 0;
}

.pricing-cards {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.pricing-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 32px;
  width: 300px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
}

.pricing-card.featured {
  border: 2px solid #6366F1;
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #6366F1;
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pricing-card h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  text-align: center;
}

.price {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0F172A;
  text-align: center;
}

.price-period {
  text-align: center;
  color: #64748B;
  margin-bottom: 24px;
}

.pricing-card ul {
  list-style: none;
  margin-bottom: 24px;
}

.pricing-card li {
  padding: 10px 0;
  color: #64748B;
  border-bottom: 1px solid #F1F5F9;
}

.pricing-card li:last-child {
  border-bottom: none;
}

.pricing-card li::before {
  content: "✓ ";
  color: #10B981;
  font-weight: 700;
}

/* FAQ */
.faq {
  margin: 60px 0;
}

.faq h2 {
  text-align: center;
  margin-bottom: 32px;
}

.faq-item {
  background: #FFFFFF;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.faq-item h4 {
  margin-bottom: 8px;
  color: #0F172A;
}

.faq-item p {
  color: #64748B;
}

/* About Page */
.about-header {
  text-align: center;
  padding: 40px 20px;
}

.about-header h1 {
  margin-bottom: 8px;
}

.about-header p {
  color: #64748B;
}

.about-section {
  margin-bottom: 40px;
}

.about-section h2 {
  margin-bottom: 16px;
  color: #0F172A;
}

.about-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.about-card p {
  color: #475569;
  margin-bottom: 16px;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.about-card ol {
  margin-left: 20px;
  color: #475569;
}

.about-card ol li {
  margin-bottom: 8px;
}

.about-card.warning {
  border-left: 4px solid #F59E0B;
}

.about-card.warning h3 {
  color: #D97706;
  margin-bottom: 16px;
}

.limitation-item {
  background: #F8FAFC;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.limitation-item:last-child {
  margin-bottom: 0;
}

.limitation-item h4 {
  color: #0F172A;
  margin-bottom: 8px;
  font-size: 1rem;
}

.limitation-item p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.use-case {
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.use-case:last-child {
  margin-bottom: 0;
}

.use-case.good {
  background: #DCFCE7;
}

.use-case.good h4 {
  color: #16A34A;
}

.use-case.caution {
  background: #FEE2E2;
}

.use-case.caution h4 {
  color: #DC2626;
}

.use-case ul {
  margin-left: 20px;
  margin-top: 12px;
}

.use-case li {
  margin-bottom: 8px;
  color: #475569;
}

.about-card a {
  color: #6366F1;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  color: #94A3B8;
  font-size: 0.9rem;
}

/* Utility */
.hidden {
  display: none !important;
}

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

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

  .user-bar {
    flex-wrap: wrap;
  }

  .pricing-cards {
    flex-direction: column;
    align-items: center;
  }

  .steps {
    flex-direction: column;
    align-items: center;
  }
}
