/* =============================================================================
   RAGMe Design System
   Brand colors: Indigo/Violet (#6366f1 primary)
   ============================================================================= */

:root {
  --ragme-primary: #6366f1;
  --ragme-primary-dark: #4f46e5;
  --ragme-primary-light: #818cf8;
  --ragme-primary-bg: #eef2ff;
  --ragme-secondary: #8b5cf6;
  --ragme-accent: #a78bfa;
  --ragme-text: #1e1b4b;
  --ragme-text-secondary: #4338ca;
  --ragme-text-muted: #6b7280;
  --ragme-bg: #fafafe;
  --ragme-surface: #ffffff;
  --ragme-border: #e5e7eb;
  --ragme-success: #10b981;
  --ragme-warning: #f59e0b;
  --ragme-error: #ef4444;
  --ragme-radius: 12px;
  --ragme-radius-sm: 8px;
  --ragme-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --ragme-shadow-lg: 0 10px 25px rgba(99, 102, 241, 0.15);
}

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

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

/* =============================================================================
   Layout
   ============================================================================= */

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

.ragme-narrow {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================================================
   Navigation
   ============================================================================= */

.ragme-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--ragme-surface);
  border-bottom: 1px solid var(--ragme-border);
}

.ragme-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ragme-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.ragme-logo span {
  color: var(--ragme-secondary);
}

/* =============================================================================
   Hero Section
   ============================================================================= */

.ragme-hero {
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(135deg, var(--ragme-primary-bg) 0%, #f5f3ff 50%, #faf5ff 100%);
}

.ragme-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--ragme-text);
  margin-bottom: 16px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.ragme-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--ragme-primary), var(--ragme-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ragme-hero p {
  font-size: 1.25rem;
  color: var(--ragme-text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
}

@media (max-width: 640px) {
  .ragme-hero h1 { font-size: 2rem; }
  .ragme-hero p { font-size: 1rem; }
  .ragme-hero { padding: 48px 16px; }
}

/* =============================================================================
   URL Input
   ============================================================================= */

.ragme-url-form {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  gap: 12px;
}

.ragme-url-input {
  flex: 1;
  padding: 16px 20px;
  font-size: 1rem;
  border: 2px solid var(--ragme-border);
  border-radius: var(--ragme-radius);
  outline: none;
  transition: border-color 0.2s;
}

.ragme-url-input:focus {
  border-color: var(--ragme-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

@media (max-width: 640px) {
  .ragme-url-form {
    flex-direction: column;
  }
}

/* =============================================================================
   Buttons
   ============================================================================= */

.ragme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--ragme-radius);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

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

.ragme-btn-primary:hover {
  background: var(--ragme-primary-dark);
  box-shadow: var(--ragme-shadow-lg);
  transform: translateY(-1px);
}

.ragme-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ragme-btn-secondary {
  background: var(--ragme-surface);
  color: var(--ragme-primary);
  border: 2px solid var(--ragme-primary);
}

.ragme-btn-secondary:hover {
  background: var(--ragme-primary-bg);
}

.ragme-btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* =============================================================================
   Cards
   ============================================================================= */

.ragme-card {
  background: var(--ragme-surface);
  border: 1px solid var(--ragme-border);
  border-radius: var(--ragme-radius);
  padding: 24px;
  box-shadow: var(--ragme-shadow);
}

/* =============================================================================
   Progress & Status
   ============================================================================= */

.ragme-progress {
  width: 100%;
  height: 8px;
  background: var(--ragme-border);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0;
}

.ragme-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ragme-primary), var(--ragme-secondary));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.ragme-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.ragme-status-crawling { background: #fef3c7; color: #92400e; }
.ragme-status-analyzing { background: #dbeafe; color: #1e40af; }
.ragme-status-ready { background: #d1fae5; color: #065f46; }
.ragme-status-error { background: #fee2e2; color: #991b1b; }

/* =============================================================================
   Stepper (onboarding wizard)
   ============================================================================= */

.ragme-stepper {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  margin-bottom: 32px;
}

.ragme-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ragme-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--ragme-border);
  color: var(--ragme-text-muted);
  transition: all 0.3s;
}

.ragme-step.active .ragme-step-dot {
  background: var(--ragme-primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.ragme-step.completed .ragme-step-dot {
  background: var(--ragme-success);
  color: white;
}

.ragme-step-line {
  width: 40px;
  height: 2px;
  background: var(--ragme-border);
}

.ragme-step.completed + .ragme-step .ragme-step-line,
.ragme-step.completed .ragme-step-line {
  background: var(--ragme-success);
}

.ragme-step-label {
  font-size: 0.75rem;
  color: var(--ragme-text-muted);
  display: none;
}

@media (min-width: 640px) {
  .ragme-step-label { display: block; }
}

/* =============================================================================
   Questions (multiple choice)
   ============================================================================= */

.ragme-question {
  margin-bottom: 24px;
}

.ragme-question h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.ragme-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ragme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--ragme-border);
  border-radius: var(--ragme-radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.ragme-option:hover {
  border-color: var(--ragme-primary-light);
  background: var(--ragme-primary-bg);
}

.ragme-option.selected {
  border-color: var(--ragme-primary);
  background: var(--ragme-primary-bg);
}

.ragme-option input {
  accent-color: var(--ragme-primary);
}

/* =============================================================================
   Spinner
   ============================================================================= */

.ragme-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--ragme-border);
  border-top-color: var(--ragme-primary);
  border-radius: 50%;
  animation: ragme-spin 0.6s linear infinite;
}

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

/* =============================================================================
   Features Section
   ============================================================================= */

.ragme-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 64px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.ragme-feature {
  text-align: center;
  padding: 32px 24px;
}

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

.ragme-feature h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.ragme-feature p {
  font-size: 0.95rem;
  color: var(--ragme-text-muted);
}

/* =============================================================================
   Pricing
   ============================================================================= */

.ragme-pricing {
  text-align: center;
  padding: 64px 24px;
  background: var(--ragme-surface);
}

.ragme-price-tag {
  font-size: 3rem;
  font-weight: 800;
  color: var(--ragme-primary);
}

.ragme-price-tag small {
  font-size: 1rem;
  color: var(--ragme-text-muted);
  font-weight: 400;
}

/* =============================================================================
   Footer
   ============================================================================= */

.ragme-footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--ragme-text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--ragme-border);
}

.ragme-footer a {
  color: var(--ragme-primary);
  text-decoration: none;
}
