:root {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #22252c;
  background: #fafaf9;
  color-scheme: light;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 16px; line-height: 1.6; }
button, input { font: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: wait; }
button:focus-visible { outline: 3px solid #9ba5bc; outline-offset: 3px; }

.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
}

.login-card {
  width: min(100%, 420px);
  padding: 36px;
  border: 1px solid #e4e6e9;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 50px #22252c07;
  animation: card-enter .24s ease-out both;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand img { display: block; object-fit: contain; border-radius: 12px; }
.brand strong { font-size: 20px; font-weight: 750; letter-spacing: .3px; }
h1 { margin: 32px 0 24px; font-size: 30px; line-height: 1.3; font-weight: 750; }
.form-field + .form-field { margin-top: 20px; }
.form-field label { display: block; font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.form-field input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  border: 1px solid #d8dce2;
  border-radius: 9px;
  padding: 12px 14px;
  color: #22252c;
  background: #fafafa;
  font-size: 16px;
  box-shadow: inset 0 1px 2px #22252c04;
  transition: border-color .15s, box-shadow .15s;
}
.form-field input::placeholder { color: #747a84; font-size: 14px; }
.form-field input:focus { outline: 0; border-color: #838fa7; box-shadow: 0 0 0 3px #838fa722; }
.form-field input[aria-invalid="true"] { border-color: #b6423b; }
.password-control { position: relative; }
.password-control input { padding-right: 56px; }
.password-toggle {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #626b79;
}
.password-toggle:hover { background: #edf0f3; }
.password-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.form-error { margin: 10px 0; min-height: 22px; color: #ad342d; font-size: 14px; overflow-wrap: anywhere; }
.form-error:focus { outline: 0; }
.login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid #252830;
  border-radius: 9px;
  background: #252830;
  color: #fff;
  font-size: 17px;
  font-weight: 650;
  transition: background .15s, transform .15s;
}
.login-button:hover:not(:disabled) { background: #353943; }
.login-button:active:not(:disabled) { transform: translateY(1px); }
.login-button:disabled { opacity: .75; }
.loading-spinner { width: 18px; height: 18px; border: 2px solid #ffffff55; border-top-color: #fff; border-radius: 50%; animation: spinner-turn .8s linear infinite; }
.login-note { margin: 22px 0 0; color: #626b79; font-size: 12px; line-height: 1.9; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes spinner-turn { to { transform: rotate(360deg); } }
@keyframes card-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 480px) {
  .login-page { padding-inline: 18px; }
  .login-card { padding: 28px 24px; border-radius: 15px; }
  h1 { margin-top: 28px; font-size: 28px; }
}

@media (max-height: 600px) {
  .login-page { place-items: start center; padding-block: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
