/*
  login.css - стили для страницы login.php (дизайн как reg.php).

  Разделы:
  1) База и фон
  2) Шапка (логотип, кнопки, язык, бургер)
  3) Контент (форма входа)
  4) Сообщения об ошибках/успехе
  5) Футер
  6) Адаптив (мобильное меню)
*/

/* 1) База и фон */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; transition: all 0.7s ease; }

body {
  height: 100%;
  font-family: 'Inter', serif;
  background-image: url('../img/dragon-scales.svg');
  background-color: #330055;
  background-position: center;
  background-repeat: repeat;
  overflow-x: hidden;
}

/* Каркас страницы: футер прижат к низу */
.wrapper { display: flex; flex-direction: column; min-height: 100vh; }

/* 2) Шапка */
.header-blok {
  position: sticky; top: 0; left: 0; right: 0; z-index: 1000;
  height: 80px;
  background: linear-gradient(#c08bff, #943bff);
  display: flex; justify-content: center; align-items: center;
}

.content-header-blok-1 {
  position: relative;
  max-width: 1200px; width: 100%; height: 100%;
  margin: 0 auto; padding: 0 30px;
  display: flex; align-items: center; justify-content: space-between;
}

.logo-header-blok-2 { display: flex; align-items: center; }
.logo-img { height: 60px; width: auto; }

.knopki-header-blok-3 { display: flex; align-items: center; gap: 8px; }
.dop-kpopki-header-blok-4 { display: flex; align-items: center; }

/* Кнопки в шапке (и в тексте, если нужно) */
.knopka {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; margin: 3px;
  background: linear-gradient(#fb8cff, #f934ff);
  color: #fff;
  border: 1px solid #943bff;
  border-radius: 5px;
  text-decoration: none;
  font-size: clamp(12px, 1.6vw, 16px);
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  word-break: keep-all;
  hyphens: none;
}
.knopka:hover { color: #000; background: linear-gradient(#a6fbff, #659d00); }
.knopka i { margin-right: 6px; }

/* Переключатель языка */
.language-switcher { position: relative; display: inline-block; }
.language-btn {
  background: linear-gradient(#392525, #9034ff);
  border: 1px solid #60185f;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: clamp(12px, 1.4vw, 14px);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
}
.language-btn img { margin-right: 8px; }
.language-btn i { margin-left: 8px; transition: transform 0.3s ease; transform: rotate(0deg); }
.language-btn:hover { background: linear-gradient(#000, #4234ff); color: #fbff00; }

.language-menu {
  opacity: 0; visibility: hidden;
  position: absolute; top: 100%; right: 0;
  background: #fff;
  border: 1px solid #e1e5eb;
  border-radius: 5px;
  margin-top: 8px;
  list-style: none;
  padding: 0;
  width: 150px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.language-menu li { padding: 8px 12px; }
.language-menu li a { text-decoration: none; color: #333; display: flex; align-items: center; }
.language-menu li a img { margin-right: 8px; }
.language-menu li:hover { background-color: #a6effb; }
.language-switcher.active .language-btn i { transform: rotate(180deg); }
.language-switcher.active .language-menu { opacity: 1; visibility: visible; }

/* Кнопка мобильного меню (бургер) */
.menu-toggle {
  position: relative;
  width: 40px;
  height: 32px;
  display: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.menu-toggle .bar {
  position: absolute; left: 6px; right: 6px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform .3s ease, opacity .2s ease, top .3s ease;
}
.menu-toggle .bar:nth-child(1) { top: 8px; }
.menu-toggle .bar:nth-child(2) { top: 14px; }
.menu-toggle .bar:nth-child(3) { top: 20px; }
.header-blok.menu-open .menu-toggle .bar:nth-child(1) { top: 14px; transform: rotate(45deg); }
.header-blok.menu-open .menu-toggle .bar:nth-child(2) { opacity: 0; }
.header-blok.menu-open .menu-toggle .bar:nth-child(3) { top: 14px; transform: rotate(-45deg); }

/* 3) Контент (форма входа) */
.blok-kontent { display: flex; justify-content: center; padding: 24px 16px; flex: 1; }
.login-container { display: flex; justify-content: center; align-items: center; width: 100%; }

/* Основной белый блок формы */
.login-box {
  background: #fff;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 420px;
  text-align: center;
  border-radius: 10px 40px 10px;
  border: 10px solid #ffc4f9;
}

.login-box h2 {
  margin: 0 0 1.5rem;
  font-size: 2rem;
  color: #333;
  border-bottom: 1px solid #d8b0ff;
  padding-bottom: 1rem;
}

/* Поля формы */
label { display: block; margin: 8px 0 4px; font-weight: 600; color: #333; text-align: left; }
label > input[type="checkbox"] { margin-right: 8px; vertical-align: middle; }

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 14px;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  border-color: #943bff;
  outline: none;
}

.g-recaptcha { margin: 12px 0 16px; }

/* Кнопка отправки формы */
.login-button {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(#fb8cff, #f934ff);
  border: 1px solid #943bff;
  border-radius: 5px;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}
.login-button:hover { color: #000; background: linear-gradient(#a6fbff, #659d00); }

/* Ссылка "Забыли пароль" */
.forgot-password-button {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 15px;
  font-size: 14px;
  color: #ffffff;
  background: linear-gradient(#392525, #9034ff);
  border: 1px solid #60185f;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
}
.forgot-password-button:hover { background: linear-gradient(#000, #4234ff); text-decoration: none; }

/* 4) Сообщения */
.errors { margin-bottom: 16px; text-align: left; }
.error-box {
  background-color: #ffdddd;
  border-left: 6px solid #f44336;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
}

.success { margin-bottom: 16px; }
.success p { margin: 0; }

/* 5) Футер */
.kopirait {
  width: 100%;
  background: linear-gradient(#003521,#003b3e);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  padding: 6px 0;
  gap: 2px;
}
.kopirait p { margin: 0; color: #fff; }
.kopirait .footer-meta { font-size: 12px; opacity: .85; margin-bottom: 2px; }

/* 6) Адаптив (мобайл) */
@media (max-width: 768px) {
  .knopki-header-blok-3,
  .dop-kpopki-header-blok-4 { overflow: hidden; }

  /* На мобилке меню языков должно раскрываться поверх - но только когда открыто мобильное меню */
  .header-blok.menu-open .dop-kpopki-header-blok-4 { overflow: visible; }

  .menu-toggle { display: inline-block; z-index: 1100; }
  .header-blok { height: auto; padding: 8px 0; }
  .content-header-blok-1 { flex-wrap: wrap; }

  .knopki-header-blok-3,
  .dop-kpopki-header-blok-4 {
    display: flex;
    width: 100%;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: max-height .35s ease, opacity .25s ease, transform .35s ease;
  }

  .header-blok.menu-open .knopki-header-blok-3,
  .header-blok.menu-open .dop-kpopki-header-blok-4 {
    max-height: 480px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    padding: 8px 0;
  }

  .knopki-header-blok-3 .knopka { width: 100%; max-width: 260px; text-align: center; }

  .language-switcher { width: 100%; }
  .language-btn { width: 100%; justify-content: center; }
  .language-menu { z-index: 2000; }
}
