/* ===== AUTH.CSS — стили для модального окна авторизации ===== */

/* ---- ОВЕРЛЕЙ (фон) ---- */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.auth-overlay.active {
  display: flex;
}

/* @keyframes fadeIn, slideUp — определены в index.css */

/* ---- МОДАЛЬНОЕ ОКНО ---- */
.auth-modal {
  background: #11191e;
  border: 1px solid #2a3a44;
  border-radius: 32px;
  padding: 40px 36px 36px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  margin: 20px;
  position: relative;
  animation: slideUp 0.35s ease;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Кнопка закрытия */
.auth-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #4f6a7a;
  font-size: 22px;
  cursor: pointer;
  transition: 0.2s ease;
}

.auth-close:hover {
  color: #dce9f2;
  transform: rotate(90deg);
}

/* ---- ЗАГОЛОВОК ---- */
.auth-header {
  text-align: center;
  margin-bottom: 28px;
  flex-shrink: 0;
}

.auth-header .auth-icon {
  font-size: 48px;
  color: #4f8aaa;
  margin-bottom: 12px;
  display: block;
}

.auth-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: #dce9f2;
  margin-bottom: 6px;
}

.auth-header p {
  color: #6d8fa0;
  font-size: 14px;
}

/* ----- ПРОКРУЧИВАЕМАЯ ОБЛАСТЬ ----- */
.auth-scrollable {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 4px;
  margin-right: -4px;
}

/* Кастомный скроллбар для auth-scrollable */
.auth-scrollable::-webkit-scrollbar {
  width: 3px;
}

.auth-scrollable::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.auth-scrollable::-webkit-scrollbar-thumb {
  background: rgba(79, 138, 170, 0.2);
  border-radius: 10px;
  transition: 0.2s;
}

.auth-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 138, 170, 0.5);
}

/* Для Firefox */
.auth-scrollable {
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 138, 170, 0.2) transparent;
}

/* ---- ТАБЫ (Вход / Регистрация) ---- */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: #0a1218;
  border-radius: 60px;
  padding: 4px;
  margin-bottom: 28px;
  border: 1px solid #1a2a32;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: #6d8fa0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 40px;
  cursor: pointer;
  transition: 0.25s ease;
}

.auth-tab.active {
  background: #1a2a34;
  color: #dce9f2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-tab:hover:not(.active) {
  color: #b0ccdd;
}

/* ---- ФОРМА ---- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form .form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #8aa6b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-form .form-group label i {
  color: #4f7a92;
  font-size: 14px;
  width: 18px;
}

.auth-form .form-group input {
  background: #0a1218;
  border: 1px solid #1f2f38;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  color: #eef4f8;
  transition: 0.2s ease;
  outline: none;
}

.auth-form .form-group input:focus {
  border-color: #3f8ab0;
  box-shadow: 0 0 0 3px rgba(60, 150, 200, 0.12);
  background: #0f1a22;
}

.auth-form .form-group input::placeholder {
  color: #3f5a6a;
}

/* ---- ДОПОЛНИТЕЛЬНЫЕ ОПЦИИ ---- */
.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.auth-options .remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6d8fa0;
  font-size: 13px;
  cursor: pointer;
}

.auth-options .remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3f8ab0;
  cursor: pointer;
}

.auth-options .forgot {
  color: #4f8aaa;
  font-size: 13px;
  text-decoration: none;
  transition: 0.2s ease;
}

.auth-options .forgot:hover {
  color: #70b0d0;
  text-decoration: underline;
}

/* ---- КНОПКА ВХОДА ---- */
.btn-auth-submit {
  background: linear-gradient(135deg, #1f3e4f, #0f2838);
  border: 1px solid #2f5a70;
  color: #eef6fc;
  padding: 14px 24px;
  border-radius: 60px;
  font-weight: 700;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: 0.25s ease;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-auth-submit i {
  color: #80c8f0;
  font-size: 18px;
}

.btn-auth-submit:hover {
  background: linear-gradient(135deg, #2a5068, #163240);
  border-color: #4080a0;
  box-shadow: 0 6px 20px rgba(0, 80, 140, 0.2);
  transform: translateY(-2px);
}

.btn-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---- РАЗДЕЛИТЕЛЬ ---- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #3f5a6a;
  font-size: 12px;
  margin: 6px 0 4px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #1a2a32;
}

/* ---- КНОПКА ВХОДА ЧЕРЕЗ ЯНДЕКС ---- */
.auth-yandex {
  width: 100%;
  padding: 12px;
  background: #0a1218;
  border: 1px solid #1f2f38;
  border-radius: 14px;
  color: #dce9f2;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.auth-yandex i {
  font-size: 22px;
  color: #fc3f1d;
}

.auth-yandex:hover {
  border-color: #fc3f1d;
  background: #1a0f0d;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(252, 63, 29, 0.1);
}

/* ---- ПЕРЕКЛЮЧЕНИЕ МЕЖДУ ВХОДОМ И РЕГИСТРАЦИЕЙ ---- */
.auth-switch {
  text-align: center;
  margin-top: 6px;
  color: #5f8095;
  font-size: 14px;
}

.auth-switch span {
  color: #4f8aaa;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}

.auth-switch span:hover {
  color: #70b0d0;
  text-decoration: underline;
}

/* ---- СКРЫТЫЕ ФОРМЫ ---- */
.auth-form.hidden {
  display: none;
}

/* ---- АДАПТИВНОСТЬ ---- */
@media (max-width: 480px) {
  .auth-modal {
    padding: 28px 20px 24px;
    margin: 12px;
    border-radius: 24px;
  }

  .auth-header .auth-icon {
    font-size: 36px;
  }

  .auth-header h2 {
    font-size: 22px;
  }

  .auth-options {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .auth-tabs {
    margin-bottom: 20px;
  }

  .auth-tab {
    font-size: 13px;
    padding: 8px 12px;
  }

  .auth-yandex {
    font-size: 14px;
    padding: 10px;
  }
}

/* ===== Поля пароля с кнопкой показать/скрыть (как в profile-settings) ===== */
.password-wrapper {
  display: flex;
  align-items: center;
  background: #0a1218;
  border: 1px solid #1f2f38;
  border-radius: 14px;
  transition: 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.password-wrapper:focus-within {
  border-color: #3f8ab0;
  box-shadow: 0 0 0 3px rgba(60, 150, 200, 0.12);
  background: #0f1a22;
}

.password-wrapper input {
  flex: 1;
  min-width: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 14px 0 0 14px !important;
  padding: 12px 16px !important;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  color: #eef4f8;
  outline: none;
  box-sizing: border-box;
}

.password-wrapper input:focus {
  box-shadow: none !important;
}

.password-toggle {
  background: transparent;
  border: none;
  border-left: 1px solid #1f2f38;
  padding: 12px 16px;
  cursor: pointer;
  color: #4f6a7a;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  border-radius: 0 14px 14px 0;
  flex-shrink: 0;
  flex-grow: 0;
}

.password-toggle:hover {
  color: #8aa6b8;
}

/* Добавьте в ваш css/auth.css */
.auth-message {
    font-size: 14px;
}

.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.btn-auth.logged-in {
    background: rgba(60, 150, 200, 0.15);
    border-color: #3f8ab0;
}

.btn-auth.logged-in:hover {
    background: rgba(60, 150, 200, 0.25);
}

/* Стили для формы регистрации */
.auth-form .form-group textarea {
    background: #0f161b;
    border: 1px solid #29373f;
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: #eef4f8;
    transition: 0.2s;
    outline: none;
    resize: vertical;
    min-height: 80px;
    width: 100%;
    box-sizing: border-box;
}

.auth-form .form-group textarea:focus {
    border-color: #3f8ab0;
    box-shadow: 0 0 0 3px rgba(60, 150, 200, 0.15);
    background: #121c23;
}
