/**
 * Auth Gateway Design System
 * Enterprise quality, dark theme with obsidian palette
 * 
 * Based on: Telegram Auth SaaS Design System
 */

/* ============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */

:root {
  /* Backgrounds */
  --bg-primary: #050507;
  --bg-secondary: #0b0b0e;
  --bg-tertiary: #111115;
  --bg-elevated: #18181d;
  
  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-default: rgba(255, 255, 255, 0.08);
  
  /* Text */
  --text-muted: #6b6b76;
  --text-secondary: #9999a5;
  --text-primary: #e4e4e8;
  --text-white: #f4f4f6;
  
  /* Accents */
  --accent-blue: #0a70ea;
  --accent-blue-dim: #0858b0;
  --accent-teal: #00b894;
  --accent-amber: #f9a825;
  --accent-rose: #e74c3c;
  
  /* Provider Colors */
  --telegram-blue: #229ED9;
  --discord-purple: #5865F2;
  --google-blue: #4285F4;
}

/* ============================================
   BASE RESET & TYPOGRAPHY
   ============================================ */

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

html {
  font-size: 90%; /* 10% smaller for enterprise feel */
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-white);
}

h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

p { font-size: 14px; color: var(--text-secondary); }

small { font-size: 12px; }

.caption {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Links */
a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.12s ease;
}

a:hover {
  text-decoration: underline;
}

/* ============================================
   SPACING SYSTEM
   ============================================ */

:root {
  --space-1: 4px;
  --space-2: 6px;
  --space-3: 10px;
  --space-4: 14px;
  --space-5: 20px;
  --space-6: 28px;
  --space-7: 32px;
  --space-8: 48px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s ease;
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Primary Button */
.btn-primary {
  background: var(--accent-blue);
  color: var(--text-white);
  border-color: var(--accent-blue);
}

.btn-primary:hover {
  background: var(--accent-blue-dim);
  border-color: var(--accent-blue-dim);
}

/* Secondary Button */
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-primary);
}

/* Small Button */
.btn-sm {
  height: 32px;
  padding: 6px 14px;
  font-size: 11px;
}

/* Provider Buttons */
.btn-telegram {
  background: var(--telegram-blue);
  border-color: var(--telegram-blue);
  color: var(--text-white);
}

.btn-telegram:hover {
  background: #1a8ab8;
  border-color: #1a8ab8;
}

.btn-discord {
  background: var(--discord-purple);
  border-color: var(--discord-purple);
  color: var(--text-white);
}

.btn-discord:hover {
  background: #4752c4;
  border-color: #4752c4;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: var(--space-5);
  transition: border-color 0.12s ease;
}

.card:hover {
  border-color: var(--border-default);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-input {
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.15s ease;
}

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

.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

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

/* ============================================
   STATUS BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success {
  background: rgba(0, 184, 148, 0.15);
  color: var(--accent-teal);
}

.badge-warning {
  background: rgba(249, 168, 37, 0.15);
  color: var(--accent-amber);
}

.badge-error {
  background: rgba(231, 76, 60, 0.15);
  color: var(--accent-rose);
}

.badge-muted {
  background: rgba(107, 107, 118, 0.15);
  color: var(--text-muted);
}

/* ============================================
   TABLES
   ============================================ */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: var(--bg-tertiary);
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}

.table tr:hover td {
  background: var(--bg-tertiary);
}

/* ============================================
   ICONS (SVG)
   ============================================ */

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

.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.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-4); }
.gap-5 { gap: var(--space-5); }

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { 
    opacity: 0;
    transform: scale(0.96);
  }
  to { 
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in { animation: fadeIn 0.2s ease; }
.animate-slide-up { animation: slideUp 0.2s ease; }
.animate-scale-in { animation: scaleIn 0.2s ease; }

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-white { color: var(--text-white); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  html { font-size: 85%; }
  
  .container {
    padding: 0 var(--space-4);
  }
}