:root {
  --ink: #2b2632;
  --fur: #ff9f57;
  --coral: #ff7a59;
  --cream: #fff6e6;
  --paper: #fffaf0;
  --muted: #716357;
  --error: #ad2940;
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas,
    "PingFang SC", "Microsoft YaHei", monospace;
  background-color: #f7d9a8;
  background-image:
    linear-gradient(rgba(43,38,50,.05) 2px, transparent 2px),
    linear-gradient(90deg, rgba(43,38,50,.05) 2px, transparent 2px);
  background-size: 24px 24px;
}
a { color: var(--ink); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; color: inherit; border-radius: 0; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
.login-shell { width: 100%; max-width: 440px; }
.page-label { margin: 0 0 16px; font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.login-card { background: var(--cream); border: 4px solid var(--ink); box-shadow: var(--shadow-lg); }
.card-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 18px; background: var(--fur); border-bottom: 4px solid var(--ink);
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
}
.window-dots { display: flex; gap: 5px; }
.window-dots i { width: 8px; height: 8px; background: var(--paper); border: 2px solid var(--ink); }
.card-body { padding: 28px 32px; }
.welcome { text-align: center; margin-bottom: 28px; }
.cat-avatar {
  width: 72px; height: 72px; padding: 7px; margin: 0 auto 20px;
  border: 3px solid var(--ink); background: var(--paper); box-shadow: var(--shadow-sm);
}
.cat-avatar svg { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
h1 { font-size: 24px; line-height: 1.4; margin: 0 0 8px; letter-spacing: 1px; }
.welcome p { margin: 0; font-size: 12px; line-height: 1.8; color: var(--muted); }
.field { margin-bottom: 14px; }
label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
input {
  display: block; width: 100%; min-width: 0; height: 48px; padding: 11px 12px;
  border: 3px solid var(--ink); background: var(--paper); box-shadow: var(--shadow-sm); font-size: 14px;
}
input::placeholder { color: var(--muted); opacity: 1; }
input:focus { outline: 2px solid var(--fur); outline-offset: 5px; background: #fff; }
input[aria-invalid="true"] { border-color: var(--error); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 68px; }
.password-toggle {
  position: absolute; right: 3px; top: 3px; height: 42px; min-width: 56px;
  padding: 0 10px; border: 0; border-left: 2px solid var(--ink); background: #ffedd6;
  font-size: 12px; font-weight: 700;
}
.password-toggle:hover { background: var(--fur); }
.password-toggle:focus-visible { outline-offset: -5px; }
.field-error { min-height: 16px; margin: 7px 0 0; font-size: 11px; line-height: 1.5; color: var(--error); }
.login-button {
  width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 11px 16px; border: 3px solid var(--ink); background: var(--coral);
  box-shadow: var(--shadow-sm); font-size: 15px; font-weight: 700;
  transition: transform .06s steps(1), box-shadow .06s steps(1);
}
.login-button:hover { background: #ff906e; }
.login-button:active { transform: translate(3px, 3px); box-shadow: none; }
.form-message { margin: 0; font-size: 12px; line-height: 1.7; }
.form-message:not(:empty) { margin-top: 16px; padding: 10px; border: 2px solid var(--ink); background: #ffedd6; }
.account-note { margin: 24px 0 0; padding-top: 20px; border-top: 2px dashed #d5c5b0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.8; }
.login-button:disabled { cursor: wait; background: #e8dcc8; box-shadow: none; }
.form-message.error { color: var(--error); background: #ffe3e6; border-color: var(--error); }
.card-footer {
  padding: 12px 16px; border-top: 3px solid var(--ink); background: var(--paper);
  text-align: center; font-size: 11px; color: var(--muted); letter-spacing: .5px;
}
.card-footer span { color: var(--ink); margin-right: 6px; }
.page-note { margin: 22px 0 0; text-align: center; font-size: 11px; line-height: 1.8; color: var(--muted); }
.icp-note { margin: 8px 0 0; text-align: center; font-size: 12px; line-height: 1.8; }
.icp-note a { color: var(--muted); }
@media (max-width: 480px) {
  body { padding: 20px 20px 28px; }
  .card-body { padding: 24px 20px; }
  .card-bar { padding: 12px; font-size: 11px; }
  h1 { font-size: 22px; }
  input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-button { transition: none; }
}
