html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: #242731;
  background: #eef1f5;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  direction: rtl;
}

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background-image: linear-gradient(rgba(21, 27, 38, 0.52), rgba(21, 27, 38, 0.52)), url('/static/admin/assets/images/login-bg.jpg');
  background-position: center;
  background-size: cover;
}

.login-panel {
  display: grid;
  width: min(920px, 100%);
  min-height: 570px;
  overflow: hidden;
  grid-template-columns: 0.9fr 1.1fr;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(17, 22, 31, 0.28);
}

.login-visual {
  position: relative;
  display: flex;
  min-height: 100%;
  align-items: flex-end;
  padding: 54px 46px;
  overflow: hidden;
  color: #fff;
  background-image: url('/static/admin/assets/images/login-bg-3.jpg');
  background-position: center;
  background-size: cover;
}

.visual-overlay {
  position: absolute;
  inset: 0;
  background: rgba(34, 47, 72, 0.7);
}

.visual-content {
  position: relative;
  z-index: 1;
}

.brand-logo {
  max-width: 150px;
  margin-bottom: 34px;
  filter: brightness(0) invert(1);
}

.visual-content h2 {
  margin: 0 0 18px;
  font-size: 28px;
  line-height: 1.5;
  font-weight: 700;
}

.visual-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.76);
}

.login-form-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px 68px 42px;
}

.login-header {
  margin-bottom: 32px;
  text-align: right;
}

.login-kicker {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #5b74d6;
  direction: ltr;
  text-align: right;
}

.login-header h1 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.45;
  font-weight: 700;
}

.login-header p {
  margin: 0;
  font-size: 14px;
  color: #8a8e99;
}

.form-group {
  margin-bottom: 22px;
  text-align: right;
}

.form-group label {
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 600;
  color: #4c505b;
}

.field-wrap {
  position: relative;
}

.field-wrap .form-control {
  height: 46px;
  padding-right: 42px;
  padding-left: 42px;
  border: 1px solid #dfe2e8;
  border-radius: 4px;
  box-shadow: none;
  direction: rtl;
  text-align: right;
}

.field-wrap .form-control:focus {
  border-color: #6177d3;
  box-shadow: 0 0 0 3px rgba(97, 119, 211, 0.12);
}

.field-icon {
  position: absolute;
  top: 0;
  right: 14px;
  height: 46px;
  line-height: 46px;
  font-size: 19px;
  color: #a0a5b0;
  pointer-events: none;
}

.password-toggle {
  position: absolute;
  top: 0;
  left: 5px;
  width: 40px;
  height: 46px;
  padding: 0;
  border: 0;
  color: #8d929e;
  background: transparent;
}

.captcha-row {
  display: flex;
  gap: 12px;
  direction: rtl;
}

.captcha-field {
  flex: 1;
}

.captcha-button {
  flex: 0 0 120px;
  height: 46px;
  padding: 1px;
  overflow: hidden;
  border: 1px solid #dfe2e8;
  border-radius: 4px;
  background: #f5f7fb;
}

.captcha-button img {
  display: block;
  width: 100%;
  height: 42px;
}

.login-submit {
  display: flex;
  width: 100%;
  height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  border: 0;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  background: #536ccf;
  box-shadow: 0 8px 18px rgba(83, 108, 207, 0.2);
}

.login-submit:hover,
.login-submit:focus {
  background: #465fc4;
}

.login-submit.is-loading {
  opacity: 0.7;
}

.login-alert {
  display: none;
  margin-bottom: 20px;
  padding: 11px 14px;
  border-right: 3px solid #dc5f68;
  border-radius: 3px;
  color: #a33d45;
  background: #fff1f2;
  font-size: 13px;
  line-height: 1.7;
  text-align: right;
}

.login-alert.is-visible {
  display: block;
}

.login-footer {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid #eceef2;
  font-size: 12px;
  color: #a2a6af;
  text-align: center;
}

@media (max-width: 767px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .login-page {
    display: block;
    width: 100%;
    align-items: stretch;
    padding: 0;
    overflow-x: hidden;
    background: #fff;
  }

  .login-panel {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .login-visual {
    display: none;
  }

  .login-form-wrap {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    padding: 44px 28px 30px;
    box-sizing: border-box;
  }

  .login-header,
  #login-form,
  .form-group,
  .field-wrap {
    width: 100%;
    min-width: 0;
  }

  .login-header h1 {
    font-size: 26px;
    overflow-wrap: anywhere;
  }

  .captcha-field {
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .captcha-button {
    flex-basis: 104px;
  }

  .login-form-wrap {
    padding-right: 22px;
    padding-left: 22px;
  }
}
