/**
 * Auth UI — стиль Discord register/login 1:1
 * (шрифт Inter ≈ gg sans; палитра Discord 2024)
 */
body.page-auth-guest-form,
body.page-auth-guest-form.layout--forum-page,
body.page-auth-guest-form.layout--forum-gradient-surface {
  --discord-bg: #313338;
  --discord-input: #1e1f22;
  --discord-text: #f2f3f5;
  --discord-muted: #b5bac1;
  --discord-muted-2: #949ba4;
  --discord-link: #93a6fc;
  --discord-blurple: #5865f2;
  --discord-blurple-hover: #4752c4;
  --discord-blurple-active: #3c45a5;
  --discord-focus: #5865f2;
  --discord-danger: #f23f43;
  --discord-font: "Inter", "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-family: var(--discord-font) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #1a1a1a !important;
  background-image: url('/assets/images/main-bg.webp') !important;
  background-position: top center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
}

body.page-auth-guest-form,
body.page-auth-guest-form button,
body.page-auth-guest-form input,
body.page-auth-guest-form select,
body.page-auth-guest-form textarea,
body.page-auth-guest-form .btn,
body.page-auth-guest-form .form-control,
body.page-auth-guest-form .form-label,
body.page-auth-guest-form .nk-block-title,
body.page-auth-guest-form .custom-control-label,
body.page-auth-guest-form .form-note-s2,
body.page-auth-guest-form .invalid-feedback {
  font-family: var(--discord-font) !important;
}

/* Карточка как у Discord — компактная */
body.page-auth-guest-form .auth-discord-card {
  width: 100%;
  background: var(--discord-bg);
  border-radius: 12px;
  box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2);
  padding: 32px;
  box-sizing: border-box;
  color: var(--discord-text);
}

body.page-auth-guest-form .auth-forum-form.nk-auth-body {
  padding: 0 !important;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  color: var(--discord-text) !important;
}

/* Лого внутри карточки больше нет */
body.page-auth-guest-form .auth-forum-form .brand-logo {
  display: none !important;
}

/* Заголовок — Discord h1 */
body.page-auth-guest-form .auth-forum-form .nk-block-head {
  margin-bottom: 12px !important;
}

body.page-auth-guest-form .auth-forum-form .nk-block-title {
  margin: 0 !important;
  padding: 0 !important;
  text-align: center !important;
  color: var(--discord-text) !important;
  font-size: 24px !important;
  font-weight: 600 !important;
  line-height: 30px !important;
  letter-spacing: 0 !important;
}

body.page-auth-guest-form .auth-forum-form .register-step-meta {
  margin: 6px 0 0 !important;
  padding: 0 !important;
  text-align: center !important;
  color: var(--discord-muted-2) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 18px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

/* Лейблы — uppercase Discord */
body.page-auth-guest-form .auth-forum-form .form-label,
body.page-auth-guest-form .register-form-compact .form-label,
body.page-auth-guest-form .register-form-compact .form-group > .form-label,
body.page-auth-guest-form .register-form-compact .captcha-label {
  display: block !important;
  width: 100% !important;
  text-align: left !important;
  margin-bottom: 6px !important;
  color: var(--discord-muted) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 16px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
}

body.page-auth-guest-form .register-form-compact .form-label .form-hint {
  display: inline !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  opacity: 1 !important;
  color: var(--discord-muted-2) !important;
  margin-left: 0.35em;
}

/* Компактные отступы полей — как Discord */
body.page-auth-guest-form .register-form-compact .form-group {
  margin-bottom: 14px !important;
}

body.page-auth-guest-form .register-form-compact .form-group--agreement {
  margin-bottom: 10px !important;
}

body.page-auth-guest-form .register-form-compact .form-group--captcha {
  margin-bottom: 12px !important;
}

body.page-auth-guest-form .register-form-compact .form-group--submit {
  margin-bottom: 0 !important;
  margin-top: 6px !important;
}

body.page-auth-guest-form .auth-login-form .form-group--remember {
  margin-bottom: 6px !important;
}

body.page-auth-guest-form .auth-password-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

body.page-auth-guest-form .auth-password-label-row .form-label {
  margin-bottom: 0 !important;
}

/* Инпуты Discord — без плейсхолдеров, тонкая синяя обводка на focus */
body.page-auth-guest-form .register-form-compact .form-control,
body.page-auth-guest-form .register-form-compact .form-control.form-control-lg {
  width: 100%;
  height: 40px !important;
  min-height: 40px !important;
  padding: 10px !important;
  border: 2px solid transparent !important;
  border-radius: 8px !important;
  background: var(--discord-input) !important;
  color: var(--discord-text) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 20px !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out !important;
}

body.page-auth-guest-form .register-form-compact .form-control::placeholder {
  color: transparent !important;
  opacity: 0 !important;
}

body.page-auth-guest-form .register-form-compact .form-control:focus,
body.page-auth-guest-form .register-form-compact .form-control.form-control-lg:focus,
body.page-auth-guest-form .register-form-compact .form-control.form-control-lg:focus:not(.filled):not(.name-available):not(.is-invalid):not(.name-taken) {
  border-color: var(--discord-focus) !important;
  background: var(--discord-input) !important;
  box-shadow: none !important;
  outline: none !important;
}

body.page-auth-guest-form .register-form-compact .form-control.filled,
body.page-auth-guest-form .register-form-compact .form-control.name-available,
body.page-auth-guest-form .register-form-compact .form-control.filled:focus,
body.page-auth-guest-form .register-form-compact .form-control.name-available:focus {
  border-color: transparent !important;
  background: var(--discord-input) !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .register-form-compact .form-control.filled:focus,
body.page-auth-guest-form .register-form-compact .form-control.name-available:focus {
  border-color: var(--discord-focus) !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .register-form-compact .form-control.is-invalid,
body.page-auth-guest-form .register-form-compact .form-control.name-taken {
  border-color: var(--discord-danger) !important;
  background: var(--discord-input) !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .register-form-compact .form-control.is-invalid:focus,
body.page-auth-guest-form .register-form-compact .form-control.name-taken:focus {
  border-color: var(--discord-danger) !important;
  box-shadow: none !important;
}

/* Красная звёздочка обязательных полей */
body.page-auth-guest-form .form-label-required {
  color: #f23f43 !important;
  font-weight: 700 !important;
  margin-left: 2px;
  text-transform: none !important;
}

body.page-auth-guest-form .form-control-wrap:has(.password-toggle--cursor) .form-control {
  padding-right: 44px !important;
}

body.page-auth-guest-form .form-control-wrap .password-toggle--cursor {
  color: var(--discord-muted-2) !important;
}

body.page-auth-guest-form .form-control-wrap .password-toggle--cursor:hover {
  color: var(--discord-text) !important;
}

/* Кнопка списка кодов — в одну линию с полем */
body.page-auth-guest-form .register-form-compact .register-invitation-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.page-auth-guest-form .register-form-compact .register-invitation-code-row .register-invitation-code-input {
  flex: 1 1 auto;
  min-width: 0;
}

body.page-auth-guest-form .auth-forum-form .register-form-compact .register-invitation-open-btn.btn,
body.page-auth-guest-form .auth-forum-form .register-form-compact .register-invitation-open-btn.btn.btn-primary {
  flex: 0 0 40px !important;
  align-self: center !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 8px !important;
  background: #5865f2 !important;
  background-image: none !important;
  color: #fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .register-form-compact .register-invitation-open-plus {
  display: block;
  font-size: 28px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

/* Blurple primary — Discord Continue (не трогаем кнопку кодов) */
body.page-auth-guest-form .auth-forum-form .btn-primary:not(.register-invitation-open-btn),
body.page-auth-guest-form .auth-forum-form .btn.btn-primary:not(.register-invitation-open-btn) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100%;
  min-height: 44px !important;
  height: 44px !important;
  padding: 2px 16px !important;
  margin-top: 8px !important;
  border: none !important;
  border-radius: 8px !important;
  background: var(--discord-blurple) !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 24px !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transition: background-color 0.17s ease, opacity 0.17s ease !important;
}

body.page-auth-guest-form .auth-forum-form .btn-primary:not(.register-invitation-open-btn):hover:not(:disabled):not(.disabled),
body.page-auth-guest-form .auth-forum-form .btn-primary:not(.register-invitation-open-btn):focus:not(:disabled):not(.disabled),
body.page-auth-guest-form .auth-forum-form .btn-primary.focus:not(.register-invitation-open-btn):not(:disabled):not(.disabled) {
  background: var(--discord-blurple-hover) !important;
  border: none !important;
  color: #fff !important;
  outline: none !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .register-form-compact .register-invitation-open-btn.btn:hover:not(:disabled),
body.page-auth-guest-form .register-form-compact .register-invitation-open-btn.btn:focus:not(:disabled) {
  background: #4752c4 !important;
  background-image: none !important;
  border: none !important;
  color: #fff !important;
}

body.page-auth-guest-form .auth-forum-form .btn-primary:not(:disabled):not(.disabled):active,
body.page-auth-guest-form .auth-forum-form .btn-primary:not(:disabled):not(.disabled).active {
  background: var(--discord-blurple-active) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .auth-forum-form .btn-primary:disabled,
body.page-auth-guest-form .auth-forum-form .btn-primary.disabled {
  background: var(--discord-blurple) !important;
  border: none !important;
  color: #fff !important;
  opacity: 0.5 !important;
  cursor: not-allowed;
  box-shadow: none !important;
}

body.page-auth-guest-form .register-form-compact .btn-lg {
  font-size: 16px !important;
  padding: 2px 16px !important;
  min-height: 44px !important;
  border-radius: 8px !important;
}

body.page-auth-guest-form .register-form-compact .register-step-back.btn,
body.page-auth-guest-form .auth-forum-form .register-form-compact .register-step-back.btn {
  border-radius: 8px !important;
  min-height: 44px !important;
  height: 44px !important;
  margin-top: 0 !important;
}

body.page-auth-guest-form .register-form-compact .register-step2-actions .btn-primary {
  margin-top: 8px !important;
}

/* Ссылки Discord */
body.page-auth-guest-form .auth-forgot-link,
body.page-auth-guest-form .auth-forgot-link:hover,
body.page-auth-guest-form .auth-forgot-link:focus,
body.page-auth-guest-form .auth-forum-form .auth-forgot-link,
body.page-auth-guest-form .auth-forum-form .auth-forgot-link:hover,
body.page-auth-guest-form .auth-forum-form .auth-forgot-link:focus,
body.page-auth-guest-form .form-note-s2 a,
body.page-auth-guest-form .form-note-s2 a.register-link,
body.page-auth-guest-form .form-note-s2 a.register-link:hover,
body.page-auth-guest-form .form-note-s2 a.register-link:focus,
body.page-auth-guest-form .form-note-s2 button.register-link,
body.page-auth-guest-form .form-note-s2 button.register-link:hover,
body.page-auth-guest-form .form-note-s2 button.register-link:focus,
body.page-auth-guest-form .register-form-compact .custom-control-label a,
body.page-auth-guest-form .register-form-compact .custom-control-label a:hover,
body.page-auth-guest-form .register-form-compact .custom-control-label a:focus {
  color: var(--discord-link) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

body.page-auth-guest-form .form-note-s2 button.register-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
}

body.page-auth-guest-form .form-note-s2 a:hover,
body.page-auth-guest-form .form-note-s2 a.register-link:hover,
body.page-auth-guest-form .form-note-s2 button.register-link:hover,
body.page-auth-guest-form .auth-forgot-link:hover,
body.page-auth-guest-form .auth-forgot-link:focus,
body.page-auth-guest-form .auth-forum-form .auth-forgot-link:hover,
body.page-auth-guest-form .auth-forum-form .auth-forgot-link:focus,
body.page-auth-guest-form .register-form-compact .custom-control-label a:hover {
  text-decoration: underline !important;
}

body.page-auth-guest-form .auth-forgot-link {
  font-size: 14px !important;
  line-height: 16px !important;
  text-transform: none !important;
}

body.page-auth-guest-form .form-note-s2 {
  margin-top: 8px !important;
  padding-top: 4px !important;
  text-align: left !important;
  color: var(--discord-muted-2) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 16px !important;
}

/* «Запомнить меня» — тот же размер, что «Нет аккаунта?» */
body.page-auth-guest-form .auth-login-form .form-group--remember .custom-control-label {
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 16px !important;
}

body.page-auth-guest-form .form-note-s2.text-center {
  text-align: left !important;
}

body.page-auth-guest-form .form-note-s2.pt-4 {
  padding-top: 8px !important;
}

/* Чекбокс / текст согласия — компактнее как Discord */
body.page-auth-guest-form .auth-forum-form .custom-control-label,
body.page-auth-guest-form .auth-forum-form .form-hint,
body.page-auth-guest-form .auth-forum-form .auth-forgot-lead,
body.page-auth-guest-form .auth-forum-form .auth-verification-lead,
body.page-auth-guest-form .auth-forum-form .auth-verification-hint,
body.page-auth-guest-form .auth-forum-form .auth-verification-note {
  color: var(--discord-muted-2) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 16px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body.page-auth-guest-form .register-form-compact .form-group--agreement .custom-control {
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  min-height: 0 !important;
}

/* Чекбокс: фон галочки #5865F2 */
body.page-auth-guest-form .custom-control-input:checked ~ .custom-control-label::before,
body.page-auth-guest-form .custom-control-input:checked ~ .custom-control-label:before {
  background-color: #5865f2 !important;
  border-color: #5865f2 !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .custom-control-input:checked:focus ~ .custom-control-label::before,
body.page-auth-guest-form .custom-control-input:checked:focus ~ .custom-control-label:before,
body.page-auth-guest-form .custom-control-input:checked:focus-visible ~ .custom-control-label::before,
body.page-auth-guest-form .custom-control-input:checked:focus-visible ~ .custom-control-label:before {
  background-color: #5865f2 !important;
  border-color: #5865f2 !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .custom-control-input:checked ~ .custom-control-label::after,
body.page-auth-guest-form .custom-control-input:checked ~ .custom-control-label:after {
  opacity: 1 !important;
}

body.page-auth-guest-form .auth-forum-form .auth-verification-lead strong {
  color: var(--discord-text) !important;
  font-weight: 600 !important;
}

body.page-auth-guest-form .auth-verification-lead,
body.page-auth-guest-form .auth-verification-hint,
body.page-auth-guest-form .auth-verification-note,
body.page-auth-guest-form .auth-forgot-lead {
  margin: 0 0 10px !important;
  text-align: left !important;
}

body.page-auth-guest-form .invalid-feedback {
  color: var(--discord-danger) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  margin-top: 4px !important;
  line-height: 16px !important;
  text-align: left !important;
}

/* Ошибка под кубиками 2FA — по центру ряда */
body.page-auth-guest-form .auth-verification-form .auth-verification-error,
body.page-auth-guest-form .auth-verification-form .invalid-feedback.auth-verification-error {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin-top: 8px !important;
}

/* 2FA / captcha digits — компактнее */
body.page-auth-guest-form .register-form-compact .captcha-row {
  margin-bottom: 8px !important;
}

body.page-auth-guest-form .register-form-compact .captcha-image-wrap {
  width: 280px !important;
  height: 84px !important;
  max-height: none !important;
  padding: 0 !important;
}

body.page-auth-guest-form .register-form-compact .captcha-image {
  width: 280px !important;
  height: 84px !important;
  max-height: none !important;
  object-fit: fill !important;
}

body.page-auth-guest-form .register-form-compact .verification-code-input {
  gap: 6px !important;
  margin: 0.25rem 0 0 !important;
}

body.page-auth-guest-form .register-form-compact .verification-digit {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  border: 2px solid transparent !important;
  background: var(--discord-input) !important;
  color: var(--discord-text) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .register-form-compact .verification-digit:focus {
  border-color: var(--discord-focus) !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .register-form-compact .verification-digit.filled {
  border-color: transparent !important;
  background: var(--discord-input) !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .register-form-compact .verification-digit.invalid,
body.page-auth-guest-form .register-form-compact .verification-digit.invalid:focus {
  border-color: var(--discord-danger) !important;
  box-shadow: none !important;
}

body.page-auth-guest-form .register-form-compact .captcha-timer {
  width: 36px !important;
  height: 36px !important;
}

body.page-auth-guest-form .register-form-compact .captcha-timer .ring {
  width: 36px !important;
  height: 36px !important;
}

body.page-auth-guest-form .register-form-compact .captcha-timer .ring .ring-progress {
  stroke: var(--discord-blurple) !important;
}

/* Модалка кодов — тот же шрифт */
body.register-invitation-panel-open,
.register-invitation-overlay,
.register-invitation-modal-panel {
  font-family: var(--discord-font, "Inter", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif) !important;
}

@media (max-width: 485px) {
  /* Discord mobile: grey gradient, no card chrome */
  body.page-auth-guest-form,
  body.page-auth-guest-form.layout--forum-page,
  body.page-auth-guest-form.layout--forum-gradient-surface,
  body.page-auth-guest-form.page-auth-studio-bg {
    background-color: #2b2d31 !important;
    background-image: linear-gradient(180deg, #5c5e66 0%, #3f4147 28%, #2b2d31 62%, #1e1f22 100%) !important;
    background-position: top center !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
  }

  body.page-auth-guest-form .auth-forum-page > .Pane-bg,
  body.page-auth-guest-form .auth-forum-page.forum-page > .Pane-bg,
  body.page-auth-guest-form .auth-forum-page > .Pane-bg.auth-studio-pane-bg {
    background-color: #2b2d31 !important;
    background-image: linear-gradient(180deg, #5c5e66 0%, #3f4147 28%, #2b2d31 62%, #1e1f22 100%) !important;
    background-position: top center !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
  }

  body.page-auth-guest-form .auth-discord-card {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 8px 0 24px !important;
    min-height: auto !important;
  }

  body.page-auth-guest-form .auth-forum-form .nk-block-head {
    margin-bottom: 20px !important;
  }

  body.page-auth-guest-form .auth-forum-form .nk-block-title {
    font-size: 24px !important;
    line-height: 30px !important;
    font-weight: 700 !important;
  }

  body.page-auth-guest-form .auth-forum-form .register-step-meta {
    margin-top: 8px !important;
    font-size: 14px !important;
    color: #b5bac1 !important;
  }

  body.page-auth-guest-form .auth-forum-form .btn-primary:not(.register-invitation-open-btn),
  body.page-auth-guest-form .auth-forum-form .btn.btn-primary:not(.register-invitation-open-btn) {
    margin-top: 16px !important;
    border-radius: 8px !important;
  }

  body.page-auth-guest-form .register-form-compact .register-step-back.btn,
  body.page-auth-guest-form .auth-forum-form .register-form-compact .register-step-back.btn {
    margin-top: 0 !important;
    border-radius: 8px !important;
    background: #4e5058 !important;
  }

  body.page-auth-guest-form .form-note-s2,
  body.page-auth-guest-form .form-note-s2.text-center {
    text-align: left !important;
    margin-top: 16px !important;
  }

  body.page-auth-guest-form .register-form-compact .form-control,
  body.page-auth-guest-form .register-form-compact .form-control.form-control-lg {
    border: 1px solid #1a1b1e !important;
  }
}
