:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f1e9;
  --paper: #fffaf0;
  --ink: #153b35;
  --muted: #64746f;
  --line: #d9d0bf;
  --accent: #e97925;
  --accent-dark: #b85312;
  --focus: #123f38;
  --danger-bg: #fff1f0;
  --danger-ink: #9d1d16;
  --shadow: 0 18px 55px rgba(35, 48, 44, .14);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10231b;
    --paper: #172c23;
    --ink: #eef8f3;
    --muted: #b8c9c0;
    --line: #355346;
    --accent: #ff9a45;
    --accent-dark: #ffb06a;
    --focus: #a4e4cb;
    --danger-bg: #3a1f1c;
    --danger-ink: #ffb5ad;
    --shadow: 0 18px 55px rgba(0, 0, 0, .32);
  }
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100%; margin: 0; color: var(--ink); background: var(--bg); }
.login-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(18px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}
.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  padding: clamp(20px, 5vw, 30px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.login-logo {
  width: clamp(64px, 18vw, 84px);
  height: clamp(64px, 18vw, 84px);
  border-radius: 24px;
  justify-self: center;
}
h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(32px, 9vw, 42px);
  line-height: 1;
}
.login-copy {
  margin: -6px 0 6px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.field {
  display: grid;
  gap: 8px;
  font-weight: 750;
  font-size: 14px;
}
.text-input,
.password-row {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper), var(--bg) 45%);
}
.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
}
input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 18px;
  outline: 0;
}
.text-input {
  padding: 0 14px;
}
.show-button {
  min-width: 96px;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 14px;
  color: var(--focus);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}
.login-button {
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  font: inherit;
  font-weight: 850;
  font-size: 17px;
}
.guest-button {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--focus);
  background: color-mix(in srgb, var(--paper), var(--bg) 35%);
  font: inherit;
  font-weight: 850;
  font-size: 16px;
}
.registration {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.registration h2 {
  margin: 0;
  font-size: 16px;
}
.registration p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.social-stack {
  display: grid;
  gap: 11px;
}
.social-stack[hidden], .oauth-button[hidden] { display: none; }
.oauth-button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-weight: 800;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  text-align: left;
}
.oauth-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg), var(--paper) 54%);
  font-weight: 900;
}
.oauth-button[data-unavailable="true"] {
  opacity: .62;
}
.fallback-login {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.fallback-login summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}
.fallback-login form {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}
.show-button,
.login-button,
.guest-button,
.oauth-button { cursor: pointer; }
.show-button:focus-visible,
.login-button:focus-visible,
.guest-button:focus-visible,
.oauth-button:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 58%);
  outline-offset: 3px;
}
.status {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--danger-ink);
  font-size: 14px;
  line-height: 1.35;
}
.status:not(:empty) {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--danger-bg);
}
button:disabled {
  cursor: wait;
  opacity: .72;
}
@media (max-width: 360px) {
  .password-row { grid-template-columns: minmax(0, 1fr); }
  .show-button {
    min-height: 44px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
@media (max-height: 620px) {
  .login-shell {
    align-items: start;
  }
  .login-card {
    gap: 10px;
    padding: 16px;
  }
  .login-logo {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }
}
