:root {
  color: #182230;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  --primary: #1684e8;
  --primary-hover: #0d74d0;
  --border: #d8dee8;
  --muted: #8a95a5;
  --danger: #d92d20;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  display: grid;
  grid-template-columns: minmax(360px, 38%) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
}

.brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  background: #07111f url("assets/dunes.jpg") center / cover no-repeat;
}

.brand-panel::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: rgba(2, 10, 24, 0.78);
}

.brand-panel::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.08);
}

.brand-panel__content {
  width: min(76%, 380px);
  transform: translateY(-3vh);
}

.company-name {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
}

.brand-panel h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
}

.image-credit {
  position: absolute;
  bottom: 18px;
  left: 24px;
  margin: 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

.image-credit a {
  color: inherit;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 40px;
}

.login-box {
  width: min(100%, 420px);
  transform: translateY(-2vh);
}

.portal-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid #dcecff;
  border-radius: 8px;
  color: var(--primary);
  background: #eff7ff;
  font-size: 22px;
  font-weight: 700;
}

.login-heading {
  margin-bottom: 30px;
}

.login-heading p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
}

.login-heading h2 {
  margin: 0;
  color: #172033;
  font-size: 24px;
  font-weight: 600;
}

.field {
  position: relative;
  margin-bottom: 22px;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 48px 0 44px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  color: #273244;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input::placeholder {
  color: #a4adba;
}

.field input:hover {
  border-color: #b9c3d1;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 132, 232, 0.12);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field__icon {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 15px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #a4adba;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.field__error {
  position: absolute;
  top: 49px;
  left: 2px;
  color: var(--danger);
  font-size: 12px;
}

.password-toggle {
  position: absolute;
  top: 7px;
  right: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 4px;
  color: #8f99a8;
  background: transparent;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: #4e5b6e;
  background: #f3f5f8;
  outline: none;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.eye-closed,
.password-toggle.is-visible .eye-open {
  display: none;
}

.password-toggle.is-visible .eye-closed {
  display: block;
}

.login-button {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: var(--primary);
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(22, 132, 232, 0.18);
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.login-button:hover {
  background: var(--primary-hover);
  box-shadow: 0 8px 18px rgba(22, 132, 232, 0.24);
}

.login-button:active {
  transform: translateY(1px);
}

.login-button:focus-visible {
  outline: 3px solid rgba(22, 132, 232, 0.22);
  outline-offset: 2px;
}

.form-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: #667085;
  font-size: 13px;
  text-align: center;
}

.site-record {
  position: fixed;
  z-index: 2;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  white-space: nowrap;
}

.site-record a {
  color: #8a95a5;
  text-decoration: none;
}

.site-record a:hover,
.site-record a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 820px) {
  .login-page {
    grid-template-columns: 1fr;
    grid-template-rows: 210px minmax(0, 1fr);
  }

  .brand-panel {
    justify-content: flex-start;
    background-position: center 62%;
  }

  .brand-panel__content {
    width: auto;
    margin-left: clamp(28px, 8vw, 60px);
    transform: none;
  }

  .company-name {
    margin-bottom: 10px;
    font-size: 16px;
  }

  .brand-panel h1 {
    font-size: 21px;
  }

  .image-credit {
    right: 14px;
    bottom: 10px;
    left: auto;
  }

  .login-panel {
    align-items: flex-start;
    padding: 38px 24px 28px;
  }

  .login-box {
    width: min(100%, 420px);
    transform: none;
  }
}

@media (max-height: 650px) and (min-width: 821px) {
  .login-box {
    transform: none;
  }

  .portal-mark {
    margin-bottom: 12px;
  }

  .login-heading {
    margin-bottom: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
