

/* ==========================================================================
   AI DESIGN SYSTEM - Unified AI aesthetic across all pages
   ========================================================================== */

:root {
  /* AI Color Palette */
  --ai-primary: #4d94ff;
  --ai-primary-bright: #7db5ff;
  --ai-primary-dim: rgba(77, 148, 255, 0.12);
  --ai-secondary: #b58cff;
  --ai-secondary-dim: rgba(181, 140, 255, 0.12);
  --ai-accent: #00d4aa;
  --ai-accent-dim: rgba(0, 212, 170, 0.12);
  --ai-warning: #ff6b35;
  --ai-error: #ff4757;
  
  /* Surface Colors */
  --ai-bg-deep: #080a0f;
  --ai-bg-base: #0d1117;
  --ai-bg-elevated: #161b22;
  --ai-bg-card: #1c2128;
  --ai-bg-hover: #21262d;
  
  /* Border Colors */
  --ai-border-subtle: #2d333b;
  --ai-border-default: #30363d;
  --ai-border-strong: #484f58;
  --ai-border-focus: var(--ai-primary);
  
  /* Text Colors */
  --ai-text-primary: #f0f6fc;
  --ai-text-secondary: #8b949e;
  --ai-text-muted: #6e7681;
  --ai-text-inverse: #0d1117;
  
  /* Semantic Colors */
  --ai-success: #3fb950;
  --ai-warning: #d29922;
  --ai-danger: #f85149;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  --gradient-hero: linear-gradient(180deg, rgba(77,148,255,0.08) 0%, transparent 50%),
                   radial-gradient(ellipse at 50% -20%, rgba(181,140,255,0.1) 0%, transparent 60%);
  --gradient-card: linear-gradient(145deg, var(--ai-bg-card), var(--ai-bg-elevated));
  --gradient-primary-text: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  --gradient-accent-text: linear-gradient(135deg, var(--ai-accent), #00ffcc);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.6);
  --shadow-glow-primary: 0 0 30px rgba(77,148,255,0.3);
  --shadow-glow-secondary: 0 0 30px rgba(181,140,255,0.3);
  --shadow-glow-accent: 0 0 30px rgba(0,212,170,0.3);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", "Fira Code", monospace;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* Z-Index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-tooltip: 500;
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */

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

html { 
  font-size: 16px; 
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--ai-bg-base);
  color: var(--ai-text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

::selection {
  background: var(--ai-primary-dim);
  color: var(--ai-text-primary);
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid var(--ai-border-focus);
  outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--ai-bg-base); }
::-webkit-scrollbar-thumb { background: var(--ai-border-default); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ai-border-strong); }

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-16) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-primary-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-3);
}

.section-sub {
  font-size: 1.1rem;
  color: var(--ai-text-secondary);
  max-width: 60ch;
  margin: 0 auto;
  line-height: 1.7;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  color: var(--ai-text-inverse);
  box-shadow: 0 4px 20px rgba(77,148,255,0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(77,148,255,0.5);
  filter: brightness(1.05);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: transparent;
  color: var(--ai-text-primary);
  border: 2px solid var(--ai-border-default);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--ai-primary);
  background: var(--ai-primary-dim);
  color: var(--ai-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--ai-text-secondary);
  border: 1px solid transparent;
  padding: var(--space-2) var(--space-4);
  font-weight: 500;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ai-text-primary);
  background: var(--ai-bg-hover);
}

.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

.btn-sm { padding: var(--space-2) var(--space-4); font-size: 0.85rem; }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: 1.1rem; }

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

.card {
  background: var(--gradient-card);
  border: 1px solid var(--ai-border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition-base);
  background-clip: padding-box;
}

.card:hover {
  border-color: var(--ai-border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.badge-primary {
  background: var(--ai-primary-dim);
  color: var(--ai-primary);
  border: 1px solid rgba(77,148,255,0.3);
}

.badge-secondary {
  background: var(--ai-secondary-dim);
  color: var(--ai-secondary);
  border: 1px solid rgba(181,140,255,0.3);
}

.badge-accent {
  background: var(--ai-accent-dim);
  color: var(--ai-accent);
  border: 1px solid rgba(0,212,170,0.3);
}

.badge-muted {
  background: var(--ai-bg-elevated);
  color: var(--ai-text-secondary);
  border: 1px solid var(--ai-border-default);
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ai-text-primary);
  background: var(--ai-bg-elevated);
  border: 1px solid var(--ai-border-default);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.input::placeholder { color: var(--ai-text-muted); }

.input:focus {
  outline: none;
  border-color: var(--ai-primary);
  box-shadow: 0 0 0 3px var(--ai-primary-dim);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ai-text-secondary);
  margin-bottom: var(--space-2);
}

.input-error {
  border-color: var(--ai-danger);
}

.input-error:focus {
  box-shadow: 0 0 0 3px rgba(248,81,73,0.2);
}

.error-text {
  font-size: 0.8rem;
  color: var(--ai-danger);
  margin-top: var(--space-1);
}

/* ==========================================================================
   Badges & Tags
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid;
}

.badge-sm { padding: 2px 8px; font-size: 0.55rem; }

/* ==========================================================================
   Tooltips
   ========================================================================== */

.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: var(--space-2) var(--space-3);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ai-text-primary);
  background: var(--ai-bg-elevated);
  border: 1px solid var(--ai-border-default);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-4px);
  transition: all var(--transition-fast);
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow-md);
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  border: 5px solid transparent;
  border-top-color: var(--ai-bg-elevated);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-8px);
}

.tooltip::after { border-top-color: var(--ai-bg-elevated); }

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-24px); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: none; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fade-in 0.4s ease-out forwards; }
.animate-fade-in-up { animation: fade-in-up 0.6s ease-out forwards; }
.animate-fade-in-down { animation: fade-in-down 0.6s ease-out forwards; }
.animate-slide-in-right { animation: slide-in-right 0.5s ease-out forwards; }
.animate-scale-in { animation: scale-in 0.4s ease-out forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.text-gradient {
  background: var(--gradient-primary-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-accent {
  background: var(--gradient-accent-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bg-gradient-primary { background: var(--gradient-primary); }
.bg-gradient-hero { background: var(--gradient-hero); }
.bg-gradient-card { background: var(--gradient-card); }

.glass {
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(16px);
  border: 1px solid var(--ai-border-default);
}

.glass-strong {
  background: rgba(22, 27, 34, 0.9);
  backdrop-filter: blur(24px);
  border: 1px solid var(--ai-border-strong);
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-3); }
.gap-6 { gap: var(--space-6); }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
}

/* Spacing */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* ==========================================================================
   Loading States
   ========================================================================== */

.skeleton {
  background: linear-gradient(90deg, var(--ai-bg-elevated) 25%, var(--ai-bg-hover) 50%, var(--ai-bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--ai-border-default);
  border-top-color: var(--ai-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--ai-bg-card);
  border: 1px solid var(--ai-border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slide-in-right 0.3s ease-out forwards;
  max-width: 400px;
}

.toast-success { border-left: 4px solid var(--ai-success); }
.toast-error { border-left: 4px solid var(--ai-danger); }
.toast-warning { border-left: 4px solid var(--ai-warning); }
.toast-info { border-left: 4px solid var(--ai-primary); }

.toast-icon { flex-shrink: 0; }
.toast-message { flex: 1; font-size: 0.9rem; color: var(--ai-text-primary); }
.toast-close {
  background: none;
  border: none;
  color: var(--ai-text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}
.toast-close:hover { color: var(--ai-text-primary); }

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fade-in 0.2s ease-out forwards;
}

.modal {
  background: var(--ai-bg-card);
  border: 1px solid var(--ai-border-default);
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  animation: scale-in 0.2s ease-out forwards;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--ai-border-default);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--ai-text-muted);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.modal-close:hover { color: var(--ai-text-primary); background: var(--ai-bg-hover); }

.modal-body { padding: var(--space-6); max-height: 60vh; overflow-y: auto; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--ai-border-default);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .section-title { font-size: 2rem; }
  .hero-title { font-size: 2.5rem; }
}

@media (max-width: 768px) {
  :root { --space-16: 48px; --space-12: 40px; }
  .hero-title { font-size: 2rem; }
  .hero-sub { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .cta-primary, .cta-secondary { width: 100%; justify-content: center; }
  .hero-trust { gap: 12px; font-size: 0.8rem; }
  .hero-features { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .section-title { font-size: 1.5rem; }
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  :root { --space-4: 12px; --space-6: 20px; }
  .container { padding: 0 var(--space-3); }
  .card { padding: var(--space-4); }
  .btn { padding: var(--space-3) var(--space-4); font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .hero-bg, .btn, .footer-section, .modal-overlay { display: none !important; }
  body { background: white !important; color: black !important; }
  .card { border: 1px solid #ccc !important; box-shadow: none !important; }
  a { text-decoration: underline; color: #000 !important; }
}
