:root {
  --bg: #0d0f12;
  --panel: #14171c;
  --line: #262a31;
  --line-strong: #343943;
  --ink: #e6e8eb;
  --muted: #9aa1ab;
  --faint: #6b727c;
  --field: #0d0f12;
  --btn: #e6e8eb;
  --btn-ink: #0d0f12;
  --btn-hover: #ffffff;
  --focus: #8ea3c4;
  --danger: #e2958e;
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e4e7eb;
  --line-strong: #d2d6dc;
  --ink: #14171c;
  --muted: #5b636e;
  --faint: #868d97;
  --field: #ffffff;
  --btn: #14171c;
  --btn-ink: #ffffff;
  --btn-hover: #2b3038;
  --focus: #4b6a9b;
  --danger: #b4473c;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }

.page { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.column { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: stretch; gap: 32px; }

/* Brand block: Sentinel by Perseus. The helmet is a CSS mask so it recolors per theme. */
.wordmark { display: flex; flex-direction: column; align-items: center; gap: 12px; user-select: none; }
.wordmark .rule { width: 240px; height: 1px; background: var(--line-strong); }
.sentinel { display: inline-flex; align-items: center; gap: 8px; }
.helmet { display: block; width: 22px; height: 22px; background: var(--ink);
  -webkit-mask: url(/perseus-helmet.png) center / contain no-repeat; mask: url(/perseus-helmet.png) center / contain no-repeat; }
.sentinel-name { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--ink); line-height: 1; }
.sentinel-caption { font-size: 10.5px; font-weight: 400; letter-spacing: .02em; color: var(--muted); line-height: 1; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px 28px 22px;
  display: flex; flex-direction: column; gap: 16px; }
:root[data-theme="light"] .panel { box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05); }
.heading { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.lede { margin: 0; color: var(--muted); }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 42px;
  border: 1px solid transparent; border-radius: 6px; background: var(--btn); color: var(--btn-ink);
  font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .12s ease; }
.btn:hover { background: var(--btn-hover); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn:focus-visible, input:focus-visible, .reveal:focus-visible, .theme-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.pw { display: flex; flex-direction: column; gap: 6px; }
.pw label { font-size: 13px; font-weight: 500; color: var(--ink); }
.field { position: relative; margin-bottom: 10px; }
input { width: 100%; height: 42px; padding: 0 64px 0 12px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--field); color: var(--ink); font: inherit; font-size: 14px; }
input::placeholder { color: var(--faint); }
input:focus { outline: none; border-color: var(--focus); }
.field.invalid input { border-color: var(--danger); }
.reveal { position: absolute; top: 5px; right: 5px; height: 32px; padding: 0 10px; border: 0; border-radius: 4px;
  background: transparent; color: var(--faint); font: inherit; font-size: 12px; cursor: pointer; }
.reveal:hover { color: var(--ink); }

.spinner { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent;
  display: none; animation: spin .8s linear infinite; }
.btn.busy .spinner { display: inline-block; }
.loading { height: 42px; display: flex; align-items: center; justify-content: center; color: var(--faint); }
.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.notice.error { color: var(--danger); }
.meta { margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }

.foot { text-align: center; }
.foot p { margin: 0; font-size: 12px; color: var(--faint); }

.theme-toggle { position: fixed; top: 16px; right: 16px; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; }
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 440px) {
  .panel { padding: 24px 20px 20px; }
  .wordmark .rule { width: 210px; }
}
