:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --dark: #1e293b;
  --dark-800: #0f172a;
  --dark-900: #0a0f1d;
  --light: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--dark-900) 0%, var(--dark-800) 100%);
  color: var(--light);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: center;
  align-items: center;
}

.auth-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.brand {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.logo-accent {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  margin: 0 auto 1.25rem;
  border-radius: var(--radius-full);
}

.brand h1 {
  font-size: 2.25rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.brand h1 span {
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--gray-300);
  font-size: 1.05rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--light);
  font-size: 0.95rem;
}

.form-group input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--light);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
  width: 100%;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group input::placeholder {
  color: var(--gray-500);
}

.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.toggle-password:active {
  transform: translateY(-50%) scale(0.95);
}

.hint {
  font-size: 0.825rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.forgot-password {
  color: var(--gray-300);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.forgot-password:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(90deg, var(--primary-dark), #4338ca);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-text {
  position: relative;
  z-index: 1;
}

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-loading .btn-text {
  opacity: 0;
}

.btn-loading .btn-loader {
  display: block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: var(--gray-500);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider::before {
  margin-right: 0.75rem;
}

.divider::after {
  margin-left: 0.75rem;
}

.message-container {
  padding: 0.875rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  text-align: center;
  margin-top: 0.5rem;
  display: none;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
  display: block;
}

.message-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error);
  display: block;
}

.message-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
  display: block;
}

.signup-prompt,
.login-prompt {
  text-align: center;
  color: var(--gray-300);
  font-size: 0.95rem;
  margin-top: 0.75rem;
  position: relative;
  z-index: 1;
}

.link-accent {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.link-accent:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-dark);
}

.auth-footer {
  text-align: center;
  margin-top: 2.5rem;
  color: var(--gray-500);
  font-size: 0.9rem;
  width: 100%;
  padding: 0 1.5rem;
}

/* Responsive Design */
@media (max-width: 480px) {
  .auth-card {
    padding: 2rem;
    margin: 1rem;
  }
  
  .brand h1 {
    font-size: 2rem;
  }
  
  .btn-primary {
    padding: 0.875rem;
    font-size: 0.95rem;
  }
  
  .form-group input {
    padding: 0.75rem 1rem;
  }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --dark: #1e293b;
    --dark-800: #0f172a;
    --dark-900: #0a0f1d;
    --light: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
  }
  
  body {
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    color: var(--dark);
  }
  
  .auth-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--dark);
  }
  
  .form-group input {
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--dark);
  }
  
  .form-group input::placeholder {
    color: var(--gray-400);
  }
  
  .form-group input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  }
  
  .message-container {
    background: white;
  }
  
  .auth-footer {
    color: var(--gray-600);
  }
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}