.login-page {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 24px 16px;
  background: radial-gradient(ellipse at 47% 38%, var(--surface,#fffaf0) 0%, transparent 64%),
              linear-gradient(115deg, #eee1cb, #f8efde 55%, #f2e5d0);
}
.login-card {
  position: relative;
  width: min(100%, 25rem);
  margin: 0;
  padding: 36px clamp(24px, 4vw, 40px) 24px;
  text-align: center;
}
.login-logo { display: block; width: min(88%, 236px); height: auto; margin: auto; }
.login-card h1 { margin: 0; }
#reader-count { margin: 7px 0 24px; min-height: 1.5em; color: var(--muted); font: 14px/1.5 var(--sans); }
.login-card form { display: grid; gap: 16px; padding-top: 22px; border-top: 1px solid var(--line); }
.account-field { display: grid; gap: 6px; text-align: left; font: 600 14px/1.4 var(--sans); }
.field-control { position: relative; }
.field-control > .ui-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.password-visibility { position: absolute; inset: 1px 1px 1px auto; width: 44px; display: grid; place-items: center; padding: 0; background: transparent; border: 0; color: var(--muted); }
.password-visibility:hover { color: var(--red); }
.login-card input {
  width: 100%;
  padding: 11px 12px 11px 39px;
  border: 1px solid var(--edge,#bba78e);
  border-radius: 6px;
  background: var(--surface,#fffaf2);
  color: var(--ink);
  font: 16px/1.4 var(--sans);
}
#password { padding-right: 46px; }
#account-error { margin: 0; color: var(--red); text-align: left; font: 14px/1.4 var(--sans); }
#account-error:empty { display: none; }
.submit-account { background: var(--red); color: var(--on-accent,#fff8ea); border-color: var(--red); min-height: 44px; }
.submit-account:hover { background: var(--red-deep); }
.switch-account { justify-self: center; background: none; border: 0; font: 600 14px/1.5 var(--sans); }
.switch-account:hover { text-decoration: underline; text-underline-offset: 3px; }
.login-landscape { position: fixed; inset: auto 0 0; pointer-events: none; overflow: hidden; }
.login-landscape img, .login-landscape canvas { width: 100%; height: 100%; }
.login-landscape :not([hidden]) { display: block; }
.login-backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  color: var(--muted-ink,#8c7761);
  font: 32px/1.7 "Songti SC", SimSun, serif;
}
.passage {
  position: absolute;
  width: max-content;
  max-width: min(17em, calc((100% - 25rem) / 2 - 24px));
  animation: passage var(--fade) ease-in-out var(--hold) both;
}
.passage p { margin: 0; }
.passage p + p { margin-top: .3em; }
.passage p:nth-child(even) { margin-left: .8em; }
.passage span { animation: ink .65s var(--delay) both; }
.passage .highlight { border-radius: .15em; animation: ink .65s var(--delay) both, wash 3.4s var(--delay) both; }
.passage.already-visible span { animation: none; }
.passage.retiring { animation: clear-for-landscape .8s ease-out both; }
@keyframes clear-for-landscape { to { opacity: 0; } }
@keyframes passage { from { opacity: 1; } to { opacity: 0; } }
@keyframes ink { from { opacity: 0; } to { opacity: 1; } }
@keyframes wash { 25%, 65% { background: var(--positive,#cee0bd); } }
@media (max-width: 800px) {
  .passage { max-width: calc(100% - 24px); }
  .login-page:focus-within .login-backdrop { visibility: hidden; }
}
@media (max-width: 800px) and (max-height: 680px) {
  .login-backdrop { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .passage, .passage span, .passage .highlight { animation: none; }
}

.login-card [hidden] { display: none; }
.account-field > input { padding-inline:12px; }
[data-appearance=dark] .login-page { background:radial-gradient(ellipse at 47% 38%,#361c22,var(--paper) 70%); }
