/* ============================================================
   SIGN IN: the door, and the two screens after it (an assessor's one-tap
   link and an admin's second step), one sheet for the three. The logo,
   then one card: the heading, what the server has to say, the boxes and
   the one button; the way back in when the password is forgotten sits
   under the card. The wages door's page (paye/unlock.html) is the same
   card inside the office, and links this sheet before its own. The family's colours come from office.css, linked
   first; this sheet names only the card's own shades. One face, flat
   grounds on hairlines, nothing that moves but the answer to a hand.
   ============================================================ */
:root {
  --card: #0c1322;
  --card-line: rgba(148, 163, 184, 0.16);
  --field: var(--bg);
  --notice: rgba(255, 255, 255, 0.03);
  --text: #f3f6fc;
  --text-2: rgba(226, 232, 244, 0.74);
  --text-3: rgba(226, 232, 244, 0.56);
  --button-hover: #67e8f9;
  --button-edge: var(--cyan);
}
html[data-theme="light"] {
  --card: #ffffff;
  --card-line: #d3dae4;
  --field: #ffffff;
  --notice: #f6f8fb;
  --text: #141a26;
  --text-2: #3a4454;
  --text-3: #4a5464;
  --button-hover: #1fc6e0;
  --button-edge: #13b5d0;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.door {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: calc(env(safe-area-inset-top) + 40px) 16px 24px;
}
.brand-wordmark {
  width: 112px;
  height: 64px;
  flex: none;
  margin: 0 0 28px;
  background: var(--text);
  -webkit-mask: url(/icons/wordmark.png) center / contain no-repeat;
  mask: url(/icons/wordmark.png) center / contain no-repeat;
}

.card {
  width: 100%;
  max-width: 416px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 12px;
}
.card h1 {
  margin: 0 0 24px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.005em;
}
/* under the heading on the two screens after the door: who is signing in, or what to type */
.lead { margin: -14px 0 24px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.lead strong { font-weight: 600; color: var(--text); }

/* what the server has to say: its words in ink, its colour on the icon beside them */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  background: var(--notice);
  border: 1px solid var(--card-line);
  border-radius: 8px;
}
.notice svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.notice p { margin: 0; }
.notice strong { display: block; font-size: 14px; line-height: 1.4; font-weight: 600; }
.notice span { display: block; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.notice-red svg { color: var(--red-ink); }
.notice-amber svg { color: var(--amber-ink); }
.notice-green svg { color: var(--green-ink); }

.field { margin: 0 0 16px; }
.field label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--text-2);
}
.field input {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  font: 400 15px/1.2 var(--ui);
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--field-edge);
  border-radius: 8px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus { border-color: var(--cyan-ink); box-shadow: 0 0 0 1px var(--cyan-ink); }
/* a box the browser fills from a saved password keeps the page's own colours, not the browser's yellow or blue */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 100px var(--field) inset;
}
.field input:-webkit-autofill:focus { box-shadow: 0 0 0 100px var(--field) inset, 0 0 0 1px var(--cyan-ink); }
/* an empty box the button found is named under it, in red beside the words */
.field input[aria-invalid="true"],
.field input[aria-invalid="true"]:focus { border-color: var(--red-ink); box-shadow: 0 0 0 1px var(--red-ink); }
.field-error { margin: 6px 0 0; font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--red-ink); }
.field-error:empty { display: none; }

.pw { position: relative; }
.pw input { padding-right: 46px; }
.eye {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
}
.eye:hover { color: var(--text); }
.eye:focus-visible { outline: 2px solid var(--cyan-ink); outline-offset: -4px; }
.eye .eye-off { display: none; }
.eye[aria-pressed="true"] .eye-on { display: none; }
.eye[aria-pressed="true"] .eye-off { display: block; }

/* said only while it is true, in a region that was on the page before it spoke */
.caps { margin: 6px 0 0; font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--amber-ink); }
.caps:empty { display: none; }

.submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin: 24px 0 0;
  padding: 0 16px;
  font: 600 15px/1 var(--ui);
  color: var(--on-cyan);
  background: var(--cyan);
  border: 1px solid var(--button-edge);
  border-radius: 8px;
  cursor: pointer;
}
.submit:hover { background: var(--button-hover); }
.submit:active { transform: translateY(1px); }
.submit:focus-visible { outline: 2px solid var(--cyan-ink); outline-offset: 2px; }
.submit:disabled { cursor: progress; opacity: 0.72; transform: none; }
.one-tap .submit { margin-top: 0; }

.hint { margin: 16px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.hint a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.hint a:focus-visible { outline: 2px solid var(--cyan-ink); outline-offset: 3px; border-radius: 3px; }

/* the way back in, under the card, where the eye goes when the password will not come */
.help {
  width: 100%;
  max-width: 416px;
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-2);
}
.help p { margin: 0; }
.help p + p { margin-top: 6px; }

.foot {
  flex: none;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 20px);
  text-align: center;
}
.foot a { font-size: 12.5px; color: var(--text-3); text-decoration: underline; text-underline-offset: 3px; }
.foot a:hover { color: var(--text); }
.foot a:focus-visible { outline: 2px solid var(--cyan-ink); outline-offset: 3px; border-radius: 3px; }

/* a short screen keeps the whole door, the privacy link included, in one view */
@media (max-height: 760px) and (min-width: 521px) {
  .door { padding-top: 20px; padding-bottom: 8px; }
  .brand-wordmark { width: 92px; height: 52px; margin-bottom: 18px; }
  .card { padding: 28px 32px; }
  .card h1 { margin-bottom: 20px; }
  .foot { padding-top: 10px; padding-bottom: 14px; }
}

/* the phone: the card becomes the page, every line starts on one edge (the logo where the home page keeps it
   there), and the form sits high so the keyboard leaves the button in view */
@media (max-width: 520px) {
  .door { align-items: stretch; justify-content: flex-start; padding-top: calc(env(safe-area-inset-top) + 12px); }
  .brand-wordmark { width: 74px; height: 42px; margin-bottom: 32px; }
  .card { padding: 0; background: none; border: 0; border-radius: 0; }
  .help {
    margin-top: 24px;
    padding: 12px 0 0;
    border: 0;
    border-top: 1px solid var(--card-line);
    border-radius: 0;
    text-align: left;
  }
}
@media (max-width: 768px) {
  /* sixteen pixels or more, or a phone zooms into the box being typed in */
  .field input { height: 48px; font-size: 16px; }
  .eye { width: 44px; height: 44px; }
  .submit { height: 48px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .submit:active { transform: none; }
}
