/* The sign-in pages. The MPS palette is in ../tokens.css, which every one of these
   pages links first — served at /tokens.css without a session, because these are the
   pages rendered before there is one.

   --sh-card is the one value that stays here, and it is not the palette drifting: the
   console's --sh-lg is a modal lifting off a scrim, this card floats on a purple
   gradient and a .35 drop on it reads as dirt. Two roles, two names. */
:root { --sh-card: 0 18px 60px rgba(20,10,28,.14); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sh-card: 0 18px 60px rgba(0,0,0,.62); }
}
:root[data-theme="dark"] { --sh-card: 0 18px 60px rgba(0,0,0,.62); }

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; align-items: center;
       justify-content: center; padding: 24px;
       background: linear-gradient(148deg, var(--purple-d) 0%, var(--purple) 52%, var(--purple-l) 100%);
       color: var(--ink);
       font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
       -webkit-font-smoothing: antialiased; }
.card { width: 100%; max-width: 400px; background: var(--panel); border-radius: 14px;
        padding: 28px 30px 26px; box-shadow: var(--sh-card); }
h1 { font-size: 20px; margin: 0; letter-spacing: -0.02em; font-weight: 800; }
h1 .dot { color: var(--purple-l); }
.lead { margin: 6px 0 20px; font-size: 13px; color: var(--muted); }
label { display: block; font-size: 11px; font-weight: 700; color: var(--muted);
        letter-spacing: .02em; margin: 0 0 5px; }
input { width: 100%; font: inherit; font-size: 14px; padding: 9px 11px; margin: 0 0 15px;
        border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg);
        color: var(--ink); }
input::placeholder { color: var(--muted); }
/* A field the person has typed into and left in a state the server would refuse. The rules are
   the input's own (type, pattern, minlength, required), which mirror auth.py, so the red
   border and the server's error agree. :user-invalid waits for interaction, so an empty
   form is not red on arrival. The hint directly under the field turns red with it. */
input:user-invalid { border-color: var(--err); }
input:user-invalid + .hint { color: var(--err); }
input:focus-visible { outline: 2px solid var(--purple-l); outline-offset: 1px;
                      border-color: transparent; }
/* 12px, not 11: this is explanatory prose under a field, not a micro-label, and it is read
   once by someone who has never seen the form before. */
.hint { font-size: 12px; color: var(--muted); margin: -11px 0 15px; line-height: 1.5; }
button { width: 100%; font: inherit; font-weight: 700; font-size: 14px; padding: 10px 14px;
         border: 0; border-radius: var(--r-sm); background: var(--purple); color: #fff;
         cursor: pointer; }
button:hover { background: var(--purple-d); }
/* Show/Hide sits inside the password box; bottom: 15px is the input's own bottom margin. */
.pw { display: block; position: relative; }
.pw input { padding-right: 64px; }
button.reveal { position: absolute; top: 0; right: 4px; bottom: 15px; width: auto;
                min-width: 24px; padding: 0 10px; background: transparent;
                color: var(--purple-ink); font-size: 12.5px; font-weight: 600; }
button.reveal:hover { background: transparent; text-decoration: underline; }
.hint.caps { color: var(--err); font-weight: 600; }
/* Strength meter: segments fill by level, and the level word takes the same colour. */
.meter { margin: -7px 0 15px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.meter p { margin: 0; }
.meter-head strong { font-weight: 700; }
.meter .bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 5px 0 8px; }
.meter .bar i { height: 4px; border-radius: 2px; background: var(--line); }
.meter ul { list-style: none; margin: 0; padding: 0; }
.meter li.ok { color: var(--ink); }
.meter-sub { margin-top: 6px !important; }
.meter[data-level="0"] .bar i:nth-child(-n+1), .meter[data-level="1"] .bar i:nth-child(-n+1) { background: var(--err); }
.meter[data-level="2"] .bar i:nth-child(-n+2) { background: var(--amber); }
.meter[data-level="3"] .bar i:nth-child(-n+3) { background: var(--green); }
.meter[data-level="4"] .bar i { background: var(--green); }
.meter[data-level="0"] strong, .meter[data-level="1"] strong { color: var(--err); }
.meter[data-level="2"] strong { color: var(--amber-ink); }
.meter[data-level="3"] strong, .meter[data-level="4"] strong { color: var(--green); }
.hint[hidden] { display: none; }
button[disabled] { opacity: .55; cursor: default; }
.msg { font-size: 12.5px; border-radius: var(--r-sm); padding: 9px 11px; margin: 0 0 15px;
       border: 1px solid var(--err-line); background: var(--err-t); color: var(--err); }
.msg.ok { border-color: var(--green-line); background: var(--green-t); color: var(--green); }
.msg[hidden] { display: none; }
nav { margin: 16px 0 0; font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap;
      border-top: 1px solid var(--line); padding-top: 14px; }
nav a { color: var(--purple-ink); font-weight: 600; text-decoration: none;
        /* 24px floor in both axes — WCAG 2.5.8. The bare inline links were 20 tall. */
        display: inline-flex; align-items: center; min-height: 24px; }
nav a:hover { text-decoration: underline; }
.note { font-size: 12px; color: var(--muted); margin: 14px 0 0; line-height: 1.55; }
