* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

:root {
  /* Primary Brand Colors */
  --primary-color: #4a9eff;
  --primary-hover: #6bb0ff;
  --primary-muted: rgba(74, 158, 255, 0.15);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-accent: #64748b;

  /* Dark Theme Background Colors */
  --bg-primary: #0a0d12;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-elevated: #374151;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-selected: rgba(74, 158, 255, 0.08);

  /* Border Colors */
  --border-primary: #334155;
  --border-secondary: #475569;
  --border-accent: #64748b;

  /* Brand Colors */
  --brand-primary: #3b82f6;
  --brand-secondary: #1d4ed8;
  --brand-accent: #60a5fa;

  /* Status Colors */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.6);

  /* Glassmorphism Effects */
  --glass-bg: rgba(30, 41, 59, 0.8);
  --glass-border: rgba(148, 163, 184, 0.1);
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-family: "Inter", sans-serif;
}

/* Animated Background */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at 20% 80%,
      rgba(74, 158, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(59, 130, 246, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 40%,
      rgba(29, 78, 216, 0.08) 0%,
      transparent 50%
    );
  animation: backgroundShift 20s ease-in-out infinite;
  z-index: -1;
}

@keyframes backgroundShift {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Floating particles */
.particles {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.3;
  animation: float 20s infinite linear;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10%,
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

.container {
  width: 100%;
  max-width: 480px;
  padding: 20px;
  z-index: 1;
}

.login-form {
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  padding: 48px 40px;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.login-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
}

.form-header {
  text-align: center;
  margin-bottom: 40px;
}

.brand-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(
    135deg,
    var(--brand-primary),
    var(--brand-accent)
  );
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-lg);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: var(--shadow-lg);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(74, 158, 255, 0.4);
  }
}

.brand-icon i {
  font-size: 36px;
  color: #fff;
}

.form-title {
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.025em;
}

.form-group {
  margin-bottom: 24px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 18px;
  z-index: 2;
  transition: color 0.3s ease;
}

.input {
  width: 100%;
  padding: 18px 20px 18px 50px;
  border: 2px solid var(--border-primary);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

.input:focus {
  outline: none;
  border-color: var(--brand-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.password-toggle {
  position: absolute;
  right: 16px;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 2;
  transition: color 0.3s ease;
}

.password-toggle:hover {
  color: var(--text-primary);
}

.button {
  width: 100%;
  padding: 18px 24px;
  margin-top: 8px;
  background: linear-gradient(
    135deg,
    var(--brand-primary),
    var(--brand-secondary)
  );
  color: var(--text-primary);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.button:hover::before {
  left: 100%;
}

.button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.3);
  background: linear-gradient(
    135deg,
    var(--brand-accent),
    var(--brand-primary)
  );
}

.button:active {
  transform: translateY(-1px);
}

.button:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Spinner */
.loading-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  margin-right: 8px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Alerts */
.alert {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 12px;
  min-width: 300px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: white;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 1000;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
}

.alert.show {
  opacity: 1;
  transform: translateX(0);
}

.alert-error {
  background: rgba(24, 16, 16, 0.9);
  border-color: rgba(239, 68, 68, 0.3);
}

.alert-success {
  background: rgba(16, 24, 16, 0.9);
  border-color: rgba(16, 185, 129, 0.3);
}

.alert-icon {
  margin-right: 12px;
  font-size: 16px;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 16px;
  }

  .login-form {
    padding: 32px 24px;
    border-radius: 20px;
  }

  .form-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .brand-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
  }

  .brand-icon i {
    font-size: 28px;
  }

  .form-title {
    font-size: 1.5rem;
  }

  .input {
    padding: 16px 18px 16px 46px;
  }

  .button {
    padding: 16px 20px;
  }
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .input {
    border-color: var(--text-secondary);
  }

  .button {
    background: var(--text-primary);
    color: var(--bg-primary);
  }
}
