/* Общие стили */
body.login-page {
  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;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--dark);
  text-align: center;
}

.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;
}


/* Стили для проверки пароля */
.password-requirement .icon-wrapper {
  display: inline-block;
  width: 20px;
  height: 20px;
  position: relative;
  margin-right: 10px;
  vertical-align: middle;
}

.password-requirement .icon-wrapper i {
  position: absolute;
  top: 0;
  left: 0;
  line-height: 20px;
  width: 20px;
  text-align: center;
}

.password-check {
  margin: 10px 0 20px 0;
  padding: 0;
}

.password-requirement {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #666;
  transition: color 0.3s ease;
}

.password-requirement i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.password-requirement .fa-check {
  color: #4CAF50;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.password-requirement .fa-times {
  color: #f44336;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.password-requirement.valid {
  color: #4CAF50;
}

.password-requirement.valid .fa-check {
  opacity: 1;
}

.password-requirement.valid .fa-times {
  opacity: 0;
}

.password-requirement.invalid {
  color: #666;
}

.password-requirement.invalid .fa-check {
  opacity: 0;
}

.password-requirement.invalid .fa-times {
  opacity: 0.5;
}

/* Индикатор силы пароля */
.password-strength {
  margin-top: 15px;
  margin-bottom: 20px;
}

.strength-bar {
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 5px;
}

.strength-level {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.strength-text {
  font-size: 0.85rem;
  margin-top: 5px;
  font-weight: 500;
}

/* Стили для intl-tel-input */
.iti {
  width: 100%;
}

.phone-input-container {
  position: relative;
}

/* Поле ввода intl-tel-input */
.phone-input-container .iti input {
  width: 100% !important;
  padding-left: 110px !important; /* Отступ для кода страны */
  height: 46px;
  border: 1px solid #e0e0e0 !important;
  border-radius: 8px !important;
  font-size: 1rem !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
}

.phone-input-container .iti input:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(72, 149, 239, 0.2) !important;
}

/* Контейнер флага и кода страны */
.phone-input-container .iti__flag-container {
  position: absolute !important;
  top: 1px !important;
  left: 1px !important;
  bottom: 1px !important;
  width: 105px !important;
  background: #f8f9fa !important;
  border-radius: 7px 0 0 7px !important;
  border-right: 1px solid #e0e0e0 !important;
}

.phone-input-container .iti__selected-flag {
  padding: 0 10px !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

/* Флаг */
.phone-input-container .iti__flag {
  margin-right: 8px !important;
  transform: scale(0.9);
}

/* Код страны */
.phone-input-container .iti__selected-dial-code {
  font-weight: 500 !important;
  color: #333 !important;
  font-size: 0.95rem !important;
  white-space: nowrap;
}

/* Стрелка выпадающего списка */
.phone-input-container .iti__arrow {
  margin-left: 6px !important;
  border-top-color: #666 !important;
  width: 0;
  height: 0;
  border-left: 3px solid transparent !important;
  border-right: 3px solid transparent !important;
  border-top: 4px solid #555 !important;
}

/* Выпадающий список */
.iti__country-list {
  z-index: 1002 !important;
  max-height: 200px !important;
  overflow-y: auto !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  border-radius: 8px !important;
  border: 1px solid #e0e0e0 !important;
  margin-top: 4px !important;
}

.iti__country {
  padding: 8px 10px !important;
  font-size: 0.9rem !important;
}

.iti__dial-code {
  color: #666 !important;
}

/* При наведении на страну в списке */
.iti__country:hover,
.iti__country.highlight {
  background-color: #f5f5f5 !important;
}

/* Стиль для подсказки поиска в выпадающем списке стран */
.iti__search-hint {
  padding: 8px 12px !important;
  font-size: 12px !important;
  color: #666 !important;
  background-color: #f8f9fa !important;
  border-bottom: 1px solid #e0e0e0 !important;
  text-align: center !important;
  font-style: italic !important;
}

/* Убедитесь, что подсказка не перекрывается */
.iti__country-list {
  padding-top: 0 !important;
}

/* Стили для кнопки показа пароля */
.password-toggle-btn {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1rem;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  z-index: 2;
}

.password-toggle-btn:hover {
  color: var(--primary);
}

.password-toggle-btn:focus {
  outline: none;
  color: var(--accent);
}

/* Увеличиваем правый отступ у полей пароля для кнопки */
.input-with-icon.password-field input {
  padding-right: 45px !important;
}

/* Для полей с глазиком добавляем класс */
.input-with-icon.has-toggle {
  position: relative;
}

/* Стили для фокуса при навигации с клавиатуры */
.password-toggle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Анимация переключения иконки */
.password-toggle-btn i {
  transition: transform 0.2s ease;
}

.password-toggle-btn:active i {
  transform: scale(0.9);
}

@media (max-width: 768px) {
  /* Адаптивность для модального окна */
  #termsModal > div {
    padding: 20px;
  }
  
  .terms-container {
      padding: 20px;
      width: 95%;
  }
  
  .terms-close-btn {
    width: 100%;
  }

  .language-header {
    top: 15px;
    left: 15px;
    z-index: 1001;
  }
  
  .language-switcher {
    gap: 4px;
  }
  
  .lang-btn {
    padding: 3px 6px;
    font-size: 0.65rem;
    min-width: 45px;
    border: 1px solid var(--primary);
  }

  .logo {
    margin-left: 100px;
    position: relative;
    z-index: 1000;
  }
/* Адаптивность для intl-tel-input */
  .phone-input-container .iti__flag-container {
    width: 95px !important;
  }
  
  .phone-input-container .iti input {
    padding-left: 100px !important;
  }
  
  .phone-input-container .iti__selected-dial-code {
    font-size: 0.9rem !important;
  }
}

/* Адаптивность */
@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 {
    margin-left: 80px;
    font-size: 1.5rem !important;
  }
  
  .auth-card {
    padding: 30px 20px;
  }

  .language-header {
    top: 10px;
    left: 10px;
    z-index: 1001; 
  }
  
  .lang-btn {
    padding: 2px 5px;
    font-size: 0.6rem;
    min-width: 40px;
    border-radius: 3px;
  }
  
  /* Делаем кнопку "На главную" меньше на мобильных */
  .back-button {
    padding: 6px 12px;
    font-size: 0.8rem;
    right: 10px;
    z-index: 1000;
  }
/* Адаптивность для intl-tel-input */
  .phone-input-container .iti__flag-container {
    width: 90px !important;
  }
  
  .phone-input-container .iti input {
    padding-left: 95px !important;
    font-size: 16px !important;
  }
  
  .phone-input-container .iti__selected-flag {
    padding: 0 8px !important;
  }

  .password-toggle-btn {
    right: 22px;
    width: 22px;
    height: 22px;
  }
  
  .input-with-icon.password-field input {
    padding-right: 40px !important;
  }
}