:root {
  color-scheme: light;
  --page: #f0f3f8;
  --paper: #fcfdff;
  --ink: #1d2940;
  --muted: #526179;
  --quiet: #607087;
  --stroke: #dce3ee;
  --rule: #e2e8f1;
  --tone: #e6ecf6;
  --accent: #354e86;
  --primary: #2a3c68;
  --on-primary: #fff;
  --danger: #a23d39;
  --success: #28664d;
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 82% 9%, #dce6f6 0, transparent 38rem),
    linear-gradient(145deg, #f3f6fa 0%, var(--page) 55%, #e8edf5 100%);
}
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.page-shell {
  width: min(100% - 36px, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(26px, 8vh, 68px) 0 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.brand { display: flex; align-items: center; gap: 12px; margin: 0 4px 26px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 15px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -.05em;
  box-shadow: 0 5px 13px #20365a1a;
}
.brand-caption { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.card {
  padding: clamp(24px, 7vw, 36px);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  box-shadow: 0 18px 48px #20365a12, 0 2px 6px #20365a08;
}
.card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 16px;
  color: var(--accent);
  background: var(--tone);
}
.card-icon svg { width: 24px; height: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 650; }
h1 {
  margin: 0;
  max-width: 12ch;
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  font-size: clamp(29px, 8vw, 36px);
  font-weight: 620;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.intro { margin: 12px 0 26px; color: var(--muted); line-height: 1.55; }
form { display: grid; gap: 9px; }
label { margin-top: 5px; font-size: 14px; font-weight: 650; }
input {
  width: 100%;
  min-height: 51px;
  padding: 11px 13px;
  border: 1px solid var(--stroke);
  border-radius: 13px;
  outline: none;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px #20365a08;
}
input:focus { border-color: #667ca9; box-shadow: 0 0 0 3px #7892c52b; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 86px; }
.reveal {
  position: absolute;
  top: 5px;
  right: 6px;
  min-height: 40px;
  padding: 0 9px;
  border-radius: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}
.reveal:hover { background: var(--tone); }
.field-help { margin: -4px 2px 3px; color: var(--quiet); font-size: 12px; }
.primary {
  min-height: 52px;
  margin-top: 8px;
  padding: 11px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 680;
  box-shadow: 0 5px 12px #20365a1c;
  transition: background-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.primary:hover:not(:disabled) { background: #354e86; box-shadow: 0 8px 18px #20365a24; transform: translateY(-1px); }
.primary:focus-visible, .reveal:focus-visible { outline: 3px solid #718abd; outline-offset: 3px; }
.primary:disabled { cursor: wait; opacity: .7; }
.message, .notice { margin: 5px 0 2px; padding: 12px 13px; border-radius: 12px; line-height: 1.45; }
.message[data-kind="error"], .notice[data-kind="error"] { color: var(--danger); background: #faecea; }
.message[data-kind="success"], .notice[data-kind="success"] { color: var(--success); background: #eaf4ee; }
.message[data-kind="info"], .notice[data-kind="info"] { color: var(--muted); background: var(--tone); }
.notice { margin-top: 22px; }
.footnote { display: flex; align-items: center; gap: 9px; margin: auto 7px 0; padding-top: 28px; color: var(--quiet); font-size: 12px; }
.footnote p { margin: 0; }
.footnote-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #668470; }

@media (max-width: 380px) {
  .page-shell { width: min(100% - 26px, 430px); padding-top: 25px; }
  .brand { margin-bottom: 18px; }
  .card { padding: 23px 20px; border-radius: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #202633;
    --paper: #2a3241;
    --ink: #f2f5fc;
    --muted: #c3cee2;
    --quiet: #acbbd4;
    --stroke: #404b60;
    --rule: #3c4659;
    --tone: #323c51;
    --accent: #b7caff;
    --primary: #d0ddff;
    --on-primary: #152341;
    --danger: #ffb4ab;
    --success: #a3d8ba;
  }
  body { background: radial-gradient(ellipse at 82% 9%, #293955 0, transparent 38rem), #202633; }
  input { background: #252e3d; }
  .message[data-kind="error"], .notice[data-kind="error"] { background: #492e32; }
  .message[data-kind="success"], .notice[data-kind="success"] { background: #263d36; }
}
