/* Login page styles */
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --accent: #ec4899;
  --accent-light: #f472b6;
  --text: #0f172a;
  --text-light: #64748b;
  --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --background-alt: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --card-background: rgba(252, 251, 248, 0.95);
  --card-border: rgba(180, 160, 120, 0.3);
  --error: #ef4444;
  --border: rgba(99, 102, 241, 0.2);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 35px 60px -12px rgba(0, 0, 0, 0.35);
}

body.dark {
  --text: #f8fafc;
  --text-light: #cbd5e1;
  --background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  --background-alt: linear-gradient(135deg, #581c87 0%, #7e22ce 100%);
  --card-background: rgba(15, 23, 42, 0.8);
  --card-border: rgba(99, 102, 241, 0.3);
  --border: rgba(129, 140, 248, 0.3);
  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-dark: #6366f1;
  --accent: #f472b6;
  --accent-light: #f9a8d4;
}

/* Темные версии фоновых фигур */
body.dark .shape-1 {
  background: var(--primary);
  opacity: 0.2;
}

body.dark .shape-2 {
  background: var(--accent);
  opacity: 0.2;
}

body.dark .shape-3 {
  background: var(--primary-light);
  opacity: 0.2;
}

/* Темная версия карточки */
body.dark .login-card {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Темная версия полей ввода */
body.dark input[type='email'],
body.dark input[type='password'] {
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.dark input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
}

/* Темная версия иконок */
body.dark .input-icon {
  color: rgba(255, 255, 255, 0.6);
}

/* Темная версия кнопки */
body.dark button {
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  box-shadow: 0 10px 20px rgba(129, 140, 248, 0.2);
}

body.dark button:hover {
  box-shadow: 0 10px 20px rgba(129, 140, 248, 0.3);
}

/* Темная версия ссылки "Забыли пароль" */
body.dark .forgot-password {
  color: var(--text-light);
}

body.dark .forgot-password:hover {
  color: var(--primary-light);
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-30px) rotate(5deg);
  }
  66% {
    transform: translateY(-15px) rotate(-5deg);
  }
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--background);
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Hide any navigation elements on login page */
#navbar,
.nav-links,
.dropdown,
.nav-search {
  display: none !important;
}

.background-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  mix-blend-mode: multiply;
}

body.dark .shape {
  mix-blend-mode: screen;
}

.shape-1 {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  width: 600px;
  height: 600px;
  top: -15%;
  left: -15%;
  animation: float 10s ease-in-out infinite, pulse 8s ease-in-out infinite;
}

.shape-2 {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  width: 500px;
  height: 500px;
  bottom: -15%;
  right: -15%;
  animation: float 12s ease-in-out infinite 2s, pulse 10s ease-in-out infinite;
}

.shape-3 {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  width: 400px;
  height: 400px;
  bottom: 25%;
  left: 25%;
  animation: float 14s ease-in-out infinite 4s, pulse 12s ease-in-out infinite;
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  z-index: 1;
  animation: slide-in 0.6s ease-out;
}

.login-card {
  background: var(--card-background);
  padding: 40px 36px;
  border-radius: 28px;
  box-shadow: var(--shadow-xl), 
              0 0 0 1px var(--card-border),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.4), 
    transparent
  );
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
}

.login-header h1 {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 12px 0;
  letter-spacing: -0.5px;
}

.login-header p {
  font-size: 16px;
  color: var(--text-light);
  margin: 0;
  font-weight: 400;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  position: relative;
  margin-bottom: 4px;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-light);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1;
}

.input-group:focus-within .input-icon {
  color: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

input[type='email'],
input[type='password'] {
  width: 100%;
  padding: 16px 16px 16px 52px;
  border: 2px solid var(--border);
  border-radius: 16px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  font-weight: 400;
}

body.dark input[type='email'],
body.dark input[type='password'] {
  background: rgba(15, 23, 42, 0.6);
}

input::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15),
              0 4px 12px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

body.dark input:focus {
  background: rgba(15, 23, 42, 0.8);
}

button {
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--accent));
  background-size: 200% 200%;
  color: white;
  border: none;
  border-radius: 16px;
  padding: 16px 32px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3),
              0 0 0 0 rgba(99, 102, 241, 0);
  letter-spacing: 0.3px;
}

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

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

button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.4),
              0 0 0 4px rgba(99, 102, 241, 0.1);
  background-position: 100% 50%;
}

button:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.button-icon {
  font-size: 22px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

button:hover .button-icon {
  transform: translateX(6px);
}

button:active .button-icon {
  transform: translateX(3px);
}

.error-message {
  color: var(--error);
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  animation: slide-in 0.3s ease-out;
  font-weight: 500;
  display: none;
  min-height: auto;
}

.error-message:not(:empty) {
  display: block;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  position: relative;
  z-index: 1;
}

.forgot-password {
  color: var(--text-light);
  text-decoration: none;
  font-size: 15px;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
  display: inline-block;
}

.forgot-password::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

.forgot-password:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

.forgot-password:hover::after {
  width: 100%;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  background: var(--card-background);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  box-shadow: var(--shadow-lg),
              0 0 0 1px var(--card-border),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 0;
}

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-xl),
              0 0 0 2px var(--primary),
              0 8px 24px rgba(99, 102, 241, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.theme-toggle:active {
  transform: translateY(0) scale(0.98);
}

.theme-icon {
  font-size: 24px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
  display: block;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(15deg) scale(1.1);
}

.theme-toggle:active .theme-icon {
  transform: rotate(0deg) scale(0.95);
}

/* Dark theme for toggle button */
body.dark .theme-toggle {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(99, 102, 241, 0.3);
}

body.dark .theme-toggle:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-xl),
              0 0 0 2px var(--primary),
              0 8px 24px rgba(129, 140, 248, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .theme-toggle {
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
  
  .theme-icon {
    font-size: 22px;
  }
}
