@font-face {
  font-family: "Noto Sans SC Login";
  src: url("/login/noto-sans-sc.ttf") format("truetype");
  font-weight: 400 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #282b29;
  --green: #294d46;
  --berry: #653447;
  --secondary: #686c64;
  --divider: #d6d3c9;
  --brand-field: #eeece5;
  font: 400 16px/1.5 "Noto Sans SC Login", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: clamp(24px, 6vw, 84px);
}

.login {
  width: min(100%, 1040px);
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: clamp(44px, 8vw, 116px);
  align-items: center;
}

.brand {
  display: grid;
  place-items: center;
  aspect-ratio: 1.14;
  background: var(--brand-field);
  border-bottom-right-radius: 22% 25%;
  padding: 24px;
}

.brand img { display: block; width: min(100%, 300px); height: auto; }

.signin { width: min(100%, 328px); justify-self: start; }

h1 {
  margin: 0 0 32px;
  color: var(--green);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: .05em;
  line-height: 1.35;
}

form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
label { font-size: 14px; font-weight: 500; }

input, button { font: inherit; }

input {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--divider);
  border-radius: 0;
  padding: 0 13px;
  background: transparent;
  color: var(--ink);
  caret-color: var(--green);
}

.password { position: relative; }
.password input { padding-inline-end: 72px; }

button { cursor: pointer; }
.visibility {
  position: absolute;
  inset: 2px 2px 2px auto;
  min-width: 62px;
  border: 0;
  padding: 0 10px;
  background: transparent;
  color: var(--secondary);
  font-size: 13px;
}

.submit {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 9px 15px;
  background: var(--green);
  color: var(--paper);
  border: 1px solid transparent;
  border-radius: 0 0 12px 0;
  font-weight: 500;
  letter-spacing: .12em;
}

.submit:hover { background: #203e38; }
.visibility:hover, .preview-account:hover { color: var(--green); }

.preview-account {
  min-height: 36px;
  padding: 3px 0;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: 12px;
  text-underline-offset: 4px;
}

.preview-account:hover { text-decoration: underline; }
a.preview-account { display: inline-flex; align-items: center; text-decoration: none; }
.error { margin: -5px 0 0; color: var(--berry); font-size: 13px; }
input[aria-invalid="true"] { border-color: var(--berry); }

:is(input, button):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (max-width: 660px) {
  body { align-items: start; padding: clamp(24px, 10svh, 88px) 24px 36px; }
  .login { grid-template-columns: minmax(0, 1fr); width: min(100%, 372px); gap: 34px; }
  .brand { aspect-ratio: auto; min-height: 134px; border-bottom-right-radius: 34px; padding: 12px 18px; }
  .brand img { width: min(100%, 248px); }
  .signin { justify-self: center; }
  h1 { font-size: 27px; margin-bottom: 24px; }
}
