/* SEBERD IT Base — кастомный экран входа (/s_login) — перестроено с нуля */

@import url('https://fonts.bunny.net/css?family=ibm-plex-sans:400,500,600&display=swap');

/* === Корень: блокируем скролл страницы === */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

html.login {
  height: 100%;
  overflow: hidden;
}

/* === Body: полноэкранный flex-центр === */
body.login {
  min-width: 0;
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(56, 189, 248, .2), transparent 50%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(248, 113, 113, .15), transparent 45%),
    radial-gradient(ellipse 60% 80% at 0% 100%, rgba(139, 92, 246, .1), transparent 45%),
    #0f172a;
}

/* === Контейнер входа: карточка + мета === */
#login {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 0 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  animation: sbrd-login-enter 0.5s ease-out;
}

@keyframes sbrd-login-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Убираем логотип WordPress над формой */
.wp-login-logo,
.login h1 {
  display: none !important;
}

/* === Карточка формы === */
#login form {
  margin-top: 0;
  padding: 24px 24px 22px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, .35);
  background:
    linear-gradient(165deg, rgba(30, 41, 59, .98) 0%, rgba(15, 23, 42, .98) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .03),
    0 25px 50px -12px rgba(0, 0, 0, .5);
}

/* Прогресс входа: «сканер» при submit */
#login form.sbrd-processing {
  position: relative;
  overflow: hidden;
}

#login form.sbrd-processing::after {
  content: "";
  position: absolute;
  left: 0;
  top: -50%;
  width: 100%;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(56, 189, 248, 0) 0%,
    rgba(56, 189, 248, .4) 50%,
    rgba(56, 189, 248, 0) 100%
  );
  opacity: 0.8;
  pointer-events: none;
  animation: sbrd-login-scan 1.4s ease-out forwards;
}

@keyframes sbrd-login-scan {
  0%   { transform: translateY(0); opacity: 0.8; }
  100% { transform: translateY(280%); opacity: 0; }
}

#login form.sbrd-processing #wp-submit {
  filter: brightness(0.92);
}

/* Сообщения и ошибки */
body.login .message,
body.login #login_error,
body.login .success {
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .35);
  background: rgba(15, 23, 42, .95);
  color: #e2e8f0;
}

body.login #login_error {
  border-color: rgba(248, 113, 113, .5);
  background: rgba(127, 29, 29, .85);
}

body.login .success {
  border-color: rgba(34, 197, 94, .5);
  background: rgba(22, 101, 52, .85);
}

/* === Поля и подписи === */
#login form p label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: rgba(148, 163, 184, .95);
}

#login form .input,
#login form input[type="text"],
#login form input[type="password"],
#login form input[type="email"],
#login form input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .4);
  background: rgba(15, 23, 42, .95);
  color: #e2e8f0;
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

#login form .input:focus,
#login form input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, .8);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, .25);
}

/* Поле пароля с кнопкой показа */
#login form .user-pass-wrap {
  position: relative;
}

#login form .wp-pwd {
  position: relative;
  display: flex;
  align-items: center;
}

#login form .wp-pwd .password-input {
  padding-right: 44px;
}

#login form .wp-hide-pw {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(148, 163, 184, .9);
  cursor: pointer;
  padding: 6px;
}

#login form .wp-hide-pw:hover {
  color: #e2e8f0;
}

#login form .wp-hide-pw .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

/* Основная кнопка входа */
#login form p.submit {
  margin-top: 18px;
}

#wp-submit {
  width: 100%;
  margin: 0;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #f97316, #ec4899);
  color: #0f172a;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 0;
  box-shadow: 0 8px 24px rgba(249, 115, 22, .4);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .2s ease, filter .2s ease;
}

#wp-submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 12px 32px rgba(249, 115, 22, .5);
}

#wp-submit:active {
  transform: translateY(1px) scale(0.99);
}

/* Ссылки под формой */
.login #nav,
.login #backtoblog {
  text-align: center;
  margin: 14px 0 0;
}

.login #nav a,
.login #backtoblog a {
  color: rgba(148, 163, 184, .9);
  font-size: 13px;
  text-decoration: none;
}

.login #nav a:hover,
.login #backtoblog a:hover {
  color: #e2e8f0;
}

/* Скрываем h1 «Войти» для скринридеров */
.login .screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* === Wordfence 2FA === */
label[for="wfls-token"],
label[for="wfls-2fa-code"] {
  font-size: 12px !important;
  color: rgba(148, 163, 184, .95) !important;
}

input#wfls-token,
input#wfls-2fa-code {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .4);
  background: rgba(15, 23, 42, .95);
  color: #e2e8f0;
  padding: 10px 14px;
  font-size: 14px;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, .4);
  animation: sbrd-2fa-pulse 2.5s ease-out infinite;
}

@keyframes sbrd-2fa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(56, 189, 248, .4); }
  70%  { box-shadow: 0 0 0 14px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.wfls-2fa-code-help {
  color: rgba(148, 163, 184, .9);
}

/* Wordfence overlay-панель (не должно быть белого фона) */
body.login #wfls-prompt-overlay {
  background: rgba(15, 23, 42, .98) !important;
  color: #e2e8f0;
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .03),
    0 24px 48px rgba(0, 0, 0, .6);
}

body.login #wfls-prompt-overlay a {
  color: rgba(56, 189, 248, .9);
}

body.login #wfls-prompt-overlay a:hover {
  color: #e0f2fe;
}

/* Кнопка Wordfence 2FA «Вход» — делаем как основную */
body.login #wfls-prompt-overlay .button,
body.login #wfls-prompt-overlay .button-primary,
body.login #wfls-prompt-overlay input[type="submit"],
body.login #wfls-token-submit {
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
  border-radius: 12px;
  border: none !important;
  background: linear-gradient(135deg, #f97316, #ec4899) !important;
  color: #0f172a !important;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 0;
  box-shadow: 0 8px 24px rgba(249, 115, 22, .4);
  cursor: pointer;
  text-align: center;
  transition: transform .1s ease, box-shadow .2s ease, filter .2s ease;
}

body.login #wfls-prompt-overlay .button:hover,
body.login #wfls-prompt-overlay .button-primary:hover,
body.login #wfls-prompt-overlay input[type="submit"]:hover {
  filter: brightness(1.08);
  box-shadow: 0 12px 32px rgba(249, 115, 22, .5);
}

body.login #wfls-prompt-overlay .button:active,
body.login #wfls-prompt-overlay .button-primary:active,
body.login #wfls-prompt-overlay input[type="submit"]:active {
  transform: translateY(1px) scale(0.99);
}

/* === Caps Lock: на /s_login/ не показываем подсказку вообще (любые варианты разметки) === */
.login #caps-warning,
.login .caps-warning {
  display: none !important;
}

/* === Мини-дашборд безопасности === */
.sbrd-login-meta {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, .7);
  border: 1px solid rgba(148, 163, 184, .25);
}

.sbrd-login-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .95);
  border: 1px solid rgba(34, 197, 94, .4);
  margin-bottom: 10px;
}

.sbrd-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
  animation: sbrd-dot-pulse 2s ease-in-out infinite;
}

@keyframes sbrd-dot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); }
  50%  { opacity: 0.9; box-shadow: 0 0 8px 2px rgba(34, 197, 94, .3); }
}

.sbrd-dot-ok {
  background: #22c55e;
}

.sbrd-pill-label {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 10px;
  color: rgba(148, 163, 184, .9);
}

.sbrd-pill-value {
  font-size: 11px;
  color: rgba(226, 232, 240, .95);
}

.sbrd-login-fact {
  font-size: 12px;
  color: rgba(148, 163, 184, .9);
  line-height: 1.45;
}

/* === Переключатель языка: фиксирован внизу === */
.login .language-switcher {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.login #language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .9);
  border: 1px solid rgba(148, 163, 184, .3);
  font-size: 12px;
  color: rgba(148, 163, 184, .95);
}

.login #language-switcher .button {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .45);
  background: rgba(30, 41, 59, .9);
  color: rgba(226, 232, 240, .95);
  cursor: pointer;
}

.login #language-switcher select {
  background: transparent;
  border: none;
  color: inherit;
  font-size: inherit;
}

/* Privacy policy link */
.login .privacy-policy-page-link {
  position: fixed;
  bottom: 50px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
}

.login .privacy-policy-page-link a {
  color: rgba(148, 163, 184, .7);
}

/* === Адаптив: мобильный === */
@media (max-width: 480px) {
  #login {
    padding: 0 16px;
  }

  #login form {
    padding: 20px 18px 18px;
    border-radius: 16px;
  }

  .sbrd-login-meta {
    padding: 12px 14px;
  }
}

/* === Адаптив: очень маленькие экраны — внутренний скролл карточки === */
@media (max-height: 600px) {
  body.login {
    align-items: flex-start;
    padding-top: 20px;
    padding-bottom: 80px;
  }

  #login {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
