/* Основные переменные */
:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --accent: #4895ef;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #4cc9f0;
  --warning: #f72585;
  --text-light: #6c757d;
}

/* Общие стили */
body.login-page {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: url("../images/home/auth_background.webp") no-repeat center;
  background-size: cover;
  color: var(--dark);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

/* Затемнение фона */
body.login-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.3);
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Шапка */
.login-header {
  padding: 20px 0;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--dark);
}

.logo span {
  color: var(--primary);
}

.back-button {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 16px;
  background-color: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.back-button:hover {
  background-color: var(--secondary);
  transform: translateY(-50%) scale(1.02);
}

/* Основное содержимое */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 40px 0;
}

.auth-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
  padding: 30px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h1 {
  font-size: 2rem;
  color: var(--dark);
  margin-bottom: 10px;
}

.auth-header p {
  color: var(--text-light);
  font-size: 1rem;
}

/* Форма */
.auth-form {
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
  width: 100%;
}

.input-with-icon {
  position: relative;
  width: 100%;
}

.input-with-icon i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
}

.input-with-icon input {
  width: 100%;
  padding: 12px 20px 12px 45px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.input-with-icon input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(72, 149, 239, 0.2);
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-size: 1rem;
  box-sizing: border-box;
  width: 100%;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(63, 55, 201, 0.3);
}

.btn-block {
  display: block;
}

.btn i {
  margin-right: 8px;
}

/* Футер формы */
.auth-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 0.9rem;
}

.auth-link {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.auth-link:hover {
  color: var(--secondary);
  text-decoration: underline;
}

.divider {
  color: var(--text-light);
}

/* Подвал */
.login-footer {
  text-align: center;
  padding: 20px 0;
  background: white;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: auto;
}

/* Дополнительные стили для страницы регистрации */
.checkbox-group {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 10px;
  width: auto;
}

.checkbox-group label {
  font-size: 0.9rem;
  color: var(--text-light);
}

.checkbox-group a {
  color: var(--primary);
  text-decoration: none;
}

.checkbox-group a:hover {
  text-decoration: underline;
}

/* Стили для модального окна */
#termsModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

#termsModal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.terms-container {
  background: white;
  padding: 30px;
  border-radius: 10px;
  max-width: 800px;
  width: 90%;
  margin: auto; /* Центрирование по горизонтали */
  position: relative;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

#termsContent {
  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 20px;
  padding-right: 10px;
}

.terms-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

/* Стили для кнопки закрытия */
.terms-close-btn {
  padding: 10px 20px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.terms-close-btn:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
}

/* Полоса прокрутки */
#termsContent::-webkit-scrollbar {
  width: 8px;
}

#termsContent::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#termsContent::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

#termsContent::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* Дополнительные стили для страницы восстановления пароля */
.auth-card .auth-header h1 {
  color: var(--dark);
  margin-bottom: 10px;
}

.auth-card .auth-header p {
  color: var(--text-light);
  margin-bottom: 20px;
}

/* Иконки для конкретных элементов */
#forgot_password i {
  margin-right: 8px;
}

/* Дополнительные стили для страницы сброса пароля */
.auth-card .password-requirements {
  margin: 15px 0;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.auth-card .password-requirements ul {
  margin: 5px 0 0 20px;
  padding: 0;
}

/* Иконка для кнопки сброса */
.btn-primary .fa-sync-alt {
  margin-right: 8px;
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
  #termsModal > div {
    padding: 20px;
  }
  
  .terms-container {
      padding: 20px;
      width: 95%;
  }
  
  .terms-close-btn {
    width: 100%;
  }
}

/* Адаптивность */
@media (max-width: 576px) {
  .auth-card {
    padding: 30px 20px;
  }
  
  .auth-header h1 {
    font-size: 1.5rem;
  }
  
  .auth-footer {
    flex-direction: column;
    gap: 10px;
  }
  
  .divider {
    display: none;
  }
  
  .back-button {
    position: static;
    transform: none;
    margin-top: 15px;
    display: inline-flex;
    justify-content: center;
  }
  
  .login-header {
    padding-bottom: 15px;
    text-align: center;
  }
  
  .logo {
    display: block;
  }
  
  .auth-card {
    padding: 30px 20px;
  }
}