@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Ultra-modern SaaS Light Theme */
  --bg: #FAFAFC;
  --bg-gradient: radial-gradient(circle at top right, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
                 radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.08) 0%, transparent 40%);
  --surface: rgba(255, 255, 255, 0.8);
  --surface-border: rgba(255, 255, 255, 0.5);
  --surface-elevated: rgba(255, 255, 255, 0.95);
  --text: #0F172A;
  --text-secondary: #475569;
  --muted: #64748B;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.15);
  
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  --primary-glow: rgba(79, 70, 229, 0.25);
  
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12), 0 8px 16px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 20px var(--primary-glow);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --blur: blur(12px);
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  /* Deep, Expensive Dark Theme */
  --bg: #09090B;
  --bg-gradient: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                 radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.1) 0%, transparent 40%);
  --surface: rgba(24, 24, 27, 0.6);
  --surface-border: rgba(255, 255, 255, 0.05);
  --surface-elevated: rgba(39, 39, 42, 0.8);
  --text: #F8FAFC;
  --text-secondary: #CBD5E1;
  --muted: #94A3B8;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  
  --primary: #6366F1;
  --primary-hover: #818CF8;
  --primary-gradient: linear-gradient(135deg, #6366F1 0%, #A855F7 100%);
  --primary-glow: rgba(99, 102, 241, 0.3);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
  animation: fadeDown 0.6s ease-out forwards;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .logo {
  background: var(--primary-gradient);
  color: white;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow);
}

.subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Cards & Glassmorphism */
.card {
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  animation: fadeUp 0.6s ease-out forwards;
  opacity: 0;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card.interactive {
  cursor: pointer;
}

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

/* Typography */
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* Forms & Inputs */
.field {
  margin-bottom: 20px;
}
.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: var(--transition);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn.primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
  filter: brightness(1.1);
}

.btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--line);
}

.btn.ghost:hover {
  background: var(--line);
  color: var(--text);
}

.btn.icon-only {
  padding: 8px;
  border-radius: 50%;
  font-size: 1.2rem;
}

/* Pills / Badges */
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--line);
  color: var(--text-secondary);
}

.pill.ok {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pill.bad {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Utils */
.user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 12px;
}
.toast.err {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
