/* ============================================
   auth.css — стили авторизации
   Форма входа/регистрации, панель пользователя
   ============================================ */

/* ============================================
   Панель входа (когда не авторизован)
   ============================================ */
.login-bar {
  background: linear-gradient(135deg, #ffffff 0%, var(--pink-soft) 60%, var(--primary-soft) 100%);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.9);
  animation: fadeInDown 0.5s ease both;
}

.login-bar .btn {
  width: 100%;
  padding: 15px 24px;
  font-size: 15px;
  font-weight: 700;
}

/* ============================================
   Панель пользователя (когда авторизован)
   ============================================ */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #ffffff 0%, var(--mint-soft) 100%);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(184, 230, 208, 0.5);
  font-size: 14px;
  animation: fadeInDown 0.5s ease both;
}





.user-bar .user-logout {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-soft);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  flex-shrink: 0;
}

.user-bar .user-logout:hover {
  background: var(--pink-soft);
  color: #b94a6b;
  border-color: var(--pink);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 198, 214, 0.4);
}

/* ============================================
   Контейнер формы (внутри модалки)
   ============================================ */
.auth-container {
  max-width: 100%;
}

.auth-container h2 {
  font-size: 24px;
  color: var(--text-heading);
  text-align: center;
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-container .auth-subtitle {
  font-size: 14px;
  color: var(--text-soft);
  text-align: center;
  margin: 0 0 24px;
  line-height: 1.55;
  padding: 0 8px;
}

/* ============================================
   Форма
   ============================================ */
.auth-form .field {
  margin-bottom: 16px;
}

.auth-form .field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: 0.2px;
}

.auth-form .field input {
  padding: 13px 16px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.auth-form .btn {
  width: 100%;
  margin-top: 10px;
  padding: 15px 24px;
  font-size: 15.5px;
  font-weight: 700;
}

/* ============================================
   Переключение вход/регистрация
   ============================================ */
.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-soft);
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.auth-switch a {
  color: var(--primary-dark);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(90, 168, 194, 0.4);
}

.auth-switch a:hover {
  color: var(--text-heading);
  text-decoration-color: var(--text-heading);
}

/* ============================================
   Сообщение об ошибке
   ============================================ */
.auth-error {
  background: linear-gradient(135deg, var(--pink-soft) 0%, #fce4ee 100%);
  color: #b94a6b;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
  border-left: 4px solid var(--pink-dark);
  animation: fadeInUp 0.3s ease both;
  line-height: 1.5;
}

.auth-error.show {
  display: block;
}

/* ============================================
   Сообщение об успехе
   ============================================ */
.auth-success {
  background: linear-gradient(135deg, var(--mint-soft) 0%, #d8f0e4 100%);
  color: #2e5a48;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
  border-left: 4px solid var(--mint-dark);
  animation: fadeInUp 0.3s ease both;
  line-height: 1.5;
}

.auth-success.show {
  display: block;
}


/* ============================================
   Адаптив
   ============================================ */
@media (max-width: 768px) {
  .login-bar {
    padding: 12px 14px;
  }

  .login-bar .btn {
    font-size: 14px;
    padding: 13px 18px;
  }

  .user-bar {
    padding: 12px 16px;
    font-size: 13.5px;
  }



  .user-bar .user-logout {
    padding: 8px 14px;
    font-size: 13px;
  }

  .auth-container h2 {
    font-size: 21px;
  }

/* Модальное окно входа */
.auth-modal-custom {
  overflow: hidden; /* Чтобы рыбка не вылезала за края окна */
  position: relative;
}




@keyframes floatFish {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Кастомный чекбокс */
.auth-agreement {
  margin: 16px 0;
  text-align: left;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  display: none; /* Прячем стандартный чекбокс */
}

.checkmark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary);
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-top: 1px;
}

.checkmark::after {
  content: "✓";
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
}

/* Когда галочка нажата */
.checkbox-label input:checked + .checkmark {
  background: var(--mint-dark);
  border-color: var(--mint-dark);
}
.checkbox-label input:checked + .checkmark::after {
  opacity: 1;
  transform: scale(1);
}

.checkbox-label a {
  color: var(--primary-dark);
  text-decoration: underline;
}

  .auth-container .auth-subtitle {
    font-size: 13.5px;
    margin-bottom: 20px;
  }

  .auth-form .field input {
    padding: 12px 14px;
    font-size: 15px;
  }

  .auth-form .btn {
    padding: 14px 22px;
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .user-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .user-bar .user-logout {
    width: 100%;
  }

  .auth-container h2 {
    font-size: 19px;
  }
}
/* ---------- Блок с аватаркой и email ---------- */
.user-bar .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.user-bar .user-avatar {
  width: 38px;            /* Уменьшили размер */
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  transform: scale(1.1);  /* Легкий зум, чтобы картинка заполнила круг */
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(90, 140, 170, 0.2);
  flex-shrink: 0;
  background: #f4fafd;
  /* Убрали transition и hover-эффекты */
}

.user-bar:hover .user-avatar {
  transform: scale(1.05) rotate(-3deg);
}

/* Когда модалка открывается (класс show) — рыбка выплывает наверх */
.modal-overlay.show .fish-icon-center img {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Легкое покачивание рыбки, чтобы она казалась живой (через паузу) */
@keyframes floatFish {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.modal-overlay.show .fish-icon-center img {
  animation: floatFish 3s ease-in-out infinite;
  animation-delay: 0.6s; /* Начинает покачиваться после появления */
}


/* Видимое (целевое) состояние — рыбка на месте */
.lock-icon {
  background-image: url('../assets/images/icons/fish.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;

  opacity: 0;
  transform: translateY(15px) scale(0.8);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.4s ease;
}

/* Когда надо показать (например, добавили класс .is-visible) */
.lock-icon.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}



/* Легкое покачивание рыбки, чтобы она казалась живой (начинается после выплывания) */
@keyframes fishFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
/* Контейнер для рыбки */
.auth-fish-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  /* Плавный переход для выплывания */
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  /* Изначально рыбка спрятана (без анимации) */
  opacity: 0;
  transform: translateY(20px) scale(0.8);
}

/* Когда окно открывается, рыбка выплывает */
.modal-overlay.show .auth-fish-wrap {
  opacity: 1;
  transform: translateY(0) scale(1);
  /* Включаем плавное покачивание */
  animation: floatFish 3s ease-in-out infinite;
  animation-delay: 0.6s; /* Ждем, пока выплывет */
}

/* Размер рыбки */
.auth-fish-wrap img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

/* Ключевые кадры для покачивания */
@keyframes floatFish {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.02); }
}

/* Убираем старые стили заголовка, чтобы не мешали */
.auth-container h2::before {
  content: none !important;
}

/* Сама рыбка */
.auth-fish-wrap img {
  width: 60px; /* Маленький размер, как был замочек */
  height: 60px;
  object-fit: contain;
}

/* Когда модалка открывается — рыбка выплывает */
.modal-overlay.show .auth-fish-wrap {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: floatFish 3s ease-in-out infinite;
  animation-delay: 0.6s;
}

@keyframes floatFish {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Убираем старые стили для h2, чтобы ничего не ломало */
.auth-container h2::before {
  content: none !important;
}

/* Стили для неактивной кнопки */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
/* Слой для контента поверх фона модалки */
.auth-container {
  position: relative;
  z-index: 2; /* Поднимает контент выше, чтобы крестик не перекрывался */
}

/* Контейнер для рыбки */
.auth-fish-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.auth-fish-wrap img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

/* Крестик должен быть всегда поверх всего */
.modal-close {
  z-index: 10;
}
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #ffffff 0%, var(--mint-soft) 100%);
  border-radius: var(--radius-lg);
  padding: 10px 18px; /* Чуть уменьшили отступы */
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(184, 230, 208, 0.5);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0; /* Чтобы длинный email обрезался, а не ломал верстку */
}

/* ============================================
   ПАНЕЛЬ ПОЛЬЗОВАТЕЛЯ (ЖЕСТКАЯ ФИКСАЦИЯ)
   ============================================ */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #ffffff 0%, var(--mint-soft) 100%);
  border-radius: var(--radius-lg);
  padding: 10px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(184, 230, 208, 0.5);
  width: 100%;
  box-sizing: border-box;
}

/* Контейнер для рыбки и почты */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px; /* Расстояние между рыбкой и почтой */
  flex: 1;
}

/* Сама рыбка */
.user-bar .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  flex-shrink: 0;
}

/* ПОЧТА */
.user-bar .user-email {
  font-size: 16px !important; 
  color: #1a5e7a !important; /* Темно-синий цвет */
  font-weight: 700 !important;
  display: inline-block !important;
  margin: 0 !important;
}

/* Убираем старые иконки (человечка), если они прилипли */
.user-bar .user-email::before {
  content: none !important;
  display: none !important;
}

/* Кнопка выйти */
.user-bar .user-logout {
  background: #fff;
  color: var(--text-soft);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.user-bar .user-logout:hover {
  background: var(--pink-soft);
  color: #b94a6b;
}
/* ============================================
   Капча
   ============================================ */
.auth-captcha {
  margin-bottom: 16px;
}

.auth-captcha label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.captcha-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#captchaCanvas {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #fbfdfe;
  /* Чтобы капча не выделялась мышкой */
  user-select: none;
}

#authCaptchaInput {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  background: #fbfdfe;
  transition: all var(--transition);
  text-transform: uppercase; /* Автоматически делаем буквы заглавными */
}

#authCaptchaInput:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(126, 196, 220, 0.15);
}