/* ========================================
   DESIGN SYSTEM & GLOBAL STYLES
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

:root {
  /* Vibrant Palette (Light Theme) */
  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.2);
  --secondary: #9333ea;
  --accent: #10b981;

  /* Modern Light Theme Neutrals */
  --bg-dark: #f8fafc;
  /* Light Slate 50 */
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.6);
  --border-glass: rgba(0, 0, 0, 0.06);

  --text-main: #0f172a;
  /* Slate 900 */
  --text-dim: #475569;
  /* Slate 600 */
  --text-muted: #94a3b8;
  /* Slate 400 */

  /* Spacing System */
  --s-xs: 0.5rem;
  --s-sm: 1rem;
  --s-md: 1.5rem;
  --s-lg: 2.5rem;
  --s-xl: 4rem;

  /* Typography - JetBrains Mono */
  --font-heading: 'JetBrains Mono', monospace;
  --font-body: 'JetBrains Mono', monospace;

  /* Refined Effects */
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 15px -3px rgba(79, 70, 229, 0.15);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--s-sm);
  color: var(--text-main);
}

h1 {
  font-size: 3.5rem;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 2.5rem;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.75rem;
}

p {
  margin-bottom: var(--s-md);
  color: var(--text-dim);
  font-weight: 400;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  filter: brightness(1.2);
}

/* Layout Utilities */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--s-md);
}

.grid {
  display: grid;
  gap: var(--s-md);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Components */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--s-lg);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  border-color: rgba(79, 70, 229, 0.4);
  background: #ffffff;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1), var(--shadow-glow);
}

/* Disable hover effects for auth cards */
.auth-card:hover {
  transform: none;
  border-color: var(--border-glass);
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -10px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  backdrop-filter: blur(5px);
}

.btn-outline:hover {
  background: var(--border-glass);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Forms */
.form-group {
  margin-bottom: var(--s-md);
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-glass);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  transition: var(--transition);
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Badges */
.badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-gradient {
  background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-dim {
  color: var(--text-dim);
}

.text-muted {
  color: var(--text-muted);
}

.mt-1 {
  margin-top: var(--spacing-md);
}

.mt-2 {
  margin-top: var(--spacing-lg);
}

.mt-3 {
  margin-top: var(--spacing-xl);
}

.mb-1 {
  margin-bottom: var(--spacing-md);
}

.mb-2 {
  margin-bottom: var(--spacing-lg);
}

.mb-3 {
  margin-bottom: var(--spacing-xl);
}

.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

.fade-out {
  animation: fadeOut 0.2s ease-out forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(79, 70, 229, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --font-size-3xl: 1.75rem;
    --font-size-2xl: 1.25rem;
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .btn {
    padding: 0.675rem 1.25rem;
    font-size: var(--font-size-sm);
  }
}

/* Alert Styles */
.alert {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 10000;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 300px;
  justify-content: center;
  animation: slideDown 0.3s ease-out;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background-color: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

.modal {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  width: 90%;
  max-width: 400px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-header {
  padding: var(--s-md);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.5);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: var(--s-md);
  color: var(--text-dim);
  line-height: 1.6;
}

.modal-footer {
  padding: var(--s-md);
  display: flex;
  justify-content: flex-end;
  gap: var(--s-sm);
  background: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-footer .btn {
  padding: 10px 20px;
  font-size: 0.9rem;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}