:root {
  --paper: #fbfbfa;
  --ink: #111;
  --muted: #858383;
  --rule: #deddda;
  --accent: #5639d2;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Instrument Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 24px 72px;
}

.login-card {
  width: min(100%, 430px);
  transform: translateY(-2px);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 0 0 23px;
  font-size: 43px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.055em;
}

.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.brand-dot { color: var(--accent); }

form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 7px;
  background: #fff;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 11px 24px rgba(17, 17, 17, .07);
}

input {
  min-width: 0;
  flex: 1 1 auto;
  height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 400 16px/1 "Instrument Sans", system-ui, sans-serif;
  outline: none;
}

input::placeholder {
  color: #8b8989;
  opacity: 1;
}

form.is-auto-login {
  pointer-events: none;
}

form.is-auto-login input {
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  letter-spacing: .055em;
}

button {
  flex: 0 0 auto;
  min-width: 137px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: 600 14px/1 "Instrument Sans", system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

button,
input { touch-action: manipulation; }

button:focus-visible {
  outline: 3px solid rgba(86, 57, 210, .2);
  outline-offset: 2px;
}

button:hover { background: #482ebd; }
button:active { transform: translateY(1px); }
button:disabled { cursor: wait; opacity: .68; }

@keyframes auto-press {
  0%, 100% { transform: none; box-shadow: none; }
  45% { transform: translateY(2px) scale(.975); box-shadow: inset 0 2px 7px rgba(23, 10, 75, .28); }
}

button.is-auto-press {
  background: #4027ad;
  animation: auto-press 260ms ease both;
}

.form-message {
  min-height: 19px;
  margin: 9px 8px 0;
  color: #a22a20;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.site-address {
  position: absolute;
  bottom: 18px;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font: 400 12px/1.4 "IBM Plex Mono", monospace;
  letter-spacing: .08em;
  white-space: nowrap;
}

.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;
}

@media (max-width: 420px) {
  .login-shell { padding-inline: 12px; }
  .brand { font-size: 39px; }
  .brand img { width: 52px; height: 52px; }
  form { gap: 6px; padding: 6px; }
  input { padding-inline: 6px; }
  form.is-auto-login input { font-size: 15px; letter-spacing: .035em; }
  button { min-width: 124px; padding-inline: 11px; font-size: 13px; }
}

@media (max-width: 350px) {
  form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  input {
    width: 100%;
    height: 44px;
  }

  button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  button.is-auto-press { animation: none; }
}
