* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ui-color-bg);
  color: var(--ui-color-text);
  font-family: var(--ui-font-sans);
  overflow: hidden;
}

/* The board itself is the backdrop; no decorative shapes. */
.bg { display: none; }

.page {
  position: relative;
  width: min(392px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 2px;
}

.brand-icon {
  width: 34px;
  height: 37px;
  flex-shrink: 0;
}

.brand-icon path:first-of-type { fill: var(--n-900); }
.brand-icon path:last-of-type { fill: var(--a-400); fill-opacity: 1; }

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-title {
  color: var(--n-900);
  font-size: 26px;
  font-weight: 780;
  font-stretch: 122%;
  letter-spacing: -.02em;
  line-height: 1.05;
}

.brand-subtitle {
  color: var(--n-500);
  font-size: 12.5px;
  font-weight: 500;
}

.card {
  width: 100%;
  padding: 28px 28px 26px;
  border: 1px solid var(--n-200);
  border-radius: var(--ui-radius-xl);
  background: var(--n-0);
}

.card h1 {
  margin: 0;
  color: var(--n-900);
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -.005em;
}

.desc {
  margin: 6px 0 0;
  color: var(--n-600);
  font-size: 13px;
  line-height: 1.55;
}

.err {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--r-200);
  border-radius: var(--ui-radius-md);
  background: var(--r-50);
  color: var(--r-600);
  font-size: 13px;
  line-height: 1.45;
}

.field { margin-top: 20px; }

.input-wrap { position: relative; }

.input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--n-500);
  pointer-events: none;
}

.toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--ui-radius-sm);
  background: transparent;
  color: var(--n-500);
  cursor: pointer;
}

.toggle-password:hover { color: var(--n-900); background: var(--n-50); }
.toggle-password svg { width: 17px; height: 17px; }
.toggle-password .icon-hide { display: none; }
.toggle-password.is-visible .icon-show { display: none; }
.toggle-password.is-visible .icon-hide { display: block; }

.input-wrap input {
  width: 100%;
  min-height: 44px;
  padding: 0 44px 0 40px;
  border: 1px solid var(--n-300);
  border-radius: var(--ui-radius-md);
  color: var(--n-900);
  background: var(--n-0);
  font: inherit;
  font-size: 14px;
  letter-spacing: .02em;
  transition: border-color .15s, box-shadow .15s;
}

.input-wrap input::placeholder { color: var(--n-400); letter-spacing: 0; }

.input-wrap input:focus {
  outline: none;
  border-color: var(--a-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-500) 16%, transparent);
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--n-600);
  font-size: 13px;
  user-select: none;
  cursor: pointer;
}

.remember input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--n-900);
  cursor: pointer;
}

.submit {
  width: 100%;
  min-height: 44px;
  margin-top: 20px;
  border: 0;
  border-radius: var(--ui-radius-md);
  background: var(--n-900);
  color: var(--n-0);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color .15s;
}

.submit:hover { background: var(--n-700); }
.submit:focus-visible { outline: 2px solid var(--a-500); outline-offset: 2px; }
.submit:disabled { cursor: wait; background: var(--n-600); }

.security-note {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-inline: 2px;
  color: var(--n-500);
  font-size: 12px;
}

.security-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

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

@media (max-height: 620px) {
  body { align-items: flex-start; overflow-y: auto; }
  .page { padding-block: 28px; }
}

/* 移动端登录页：键盘弹出时允许滚动，避免按钮被顶出视口。 */
@media (max-width: 560px) {
  body {
    min-height: 100dvh;
    align-items: flex-start;
    overflow-y: auto;
  }

  .page {
    width: min(100% - 32px, 392px);
    min-height: 100dvh;
    justify-content: center;
    gap: 20px;
    padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
  }

  .card { padding: 24px 20px 22px; }
  .brand-title { font-size: 23px; }
}
