/* The sign-in page's own styles: the transcript, its blanks and its commands, on esaba.ca's grid
   (design-system.xml, "baselineAndColumns"): every row is a key in --key-col, then its value
   --col-gap later; a row of commands starts on the value's edge.
   Never contains: a token's value, or the header and page heading, which site.css (esaba.ca's
   global.css, copied by the build) holds; every colour, size and gap here is one of its tokens. */

.transcript { margin-top: var(--gap-output); }
.transcript p { margin: 0 0 12px; max-width: 72ch; overflow-wrap: anywhere; }
.transcript .line, .answer { color: var(--color-muted); }
.refusal { color: var(--color-pink-text); }
/* The server's words keep their own line breaks ("…on its way.\nIt can take a minute…"), each new
   line starting under the first; they stay text, never markup. */
.transcript .line, .refusal { white-space: pre-line; }

.answer, .ask { display: grid; grid-template-columns: var(--key-col) minmax(0, 1fr); column-gap: var(--col-gap); }
.answer { padding-block: var(--row-pad); }
.ask { align-items: center; margin: var(--gap-output) 0 0; }
.ask > label { color: var(--color-muted); }

/* The blank, as the energy digest's and the French tool's: a line to write on, not a box. One thin
   underline that stays neutral; the 12px state square before the text carries the state: idle
   grey, blue while in use, pink after a refusal until the reader types again (stateSquare). */
.field { display: flex; align-items: center; min-width: 0; }
.blank { position: relative; display: flex; align-items: center; gap: 1ch; height: 1.75em; min-width: 0;
  border-bottom: 1px solid var(--color-line); cursor: text; }
/* the blank's tap area reaches 8px above and below its line */
.blank::after { content: ""; position: absolute; top: -8px; bottom: -8px; left: 0; right: 0; }
.square { flex: none; width: 12px; height: 12px; background: var(--color-square-idle);
  transition: background-color var(--motion-duration) var(--motion-easing); }
.blank:focus-within .square { background: var(--color-square-current); }
.ask.refused .square { background: var(--color-square-wrong); }
.ask.email .blank { flex: 0 1 34ch; }
.ask.code .blank { width: calc(9ch + 12px); }
/* 16px keeps a phone from zooming into the field. */
.blank input { position: relative; z-index: 1; display: block; width: 100%; min-width: 0; height: 100%; margin: 0; padding: 0;
  border: 0; border-radius: 0; outline: none; box-shadow: none; background: transparent; color: var(--color-text);
  font: inherit; font-size: var(--text-base); font-weight: var(--weight-strong); caret-color: var(--color-blue); }
/* The square shows the keyboard's focus in the blank, so the field draws no ring of its own. */
.blank input:focus-visible { outline: none; }
/* A browser that fills in a remembered address paints the field and changes its text colour; this
   keeps the blank a line on the page's background. :autofill in a rule of its own: a browser that
   cannot read it drops the whole rule. */
.blank input:-webkit-autofill, .blank input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px var(--color-bg) inset; box-shadow: 0 0 0 100px var(--color-bg) inset;
  -webkit-text-fill-color: var(--color-text); caret-color: var(--color-blue); transition: background-color 9999s; }
.blank input:autofill {
  -webkit-box-shadow: 0 0 0 100px var(--color-bg) inset; box-shadow: 0 0 0 100px var(--color-bg) inset;
  -webkit-text-fill-color: var(--color-text); caret-color: var(--color-blue); transition: background-color 9999s; }

/* Commands (marks): a green $ and a muted word that turns blue under the pointer. The row sits under
   the blank, on the value's edge; with no blank (a code expired or locked) it follows the line
   above, on the frame's edge. */
.commands { display: flex; flex-wrap: wrap; gap: 0 var(--gap-inline); margin-top: 12px; }
.ask .commands { grid-column: 2; }
.cmd { display: inline-flex; align-items: center; gap: 1ch; min-height: var(--control-height); padding: 0; border: 0; border-radius: 0;
  background: none; color: var(--color-muted); white-space: nowrap; cursor: pointer;
  transition: color var(--motion-duration) var(--motion-easing); }
.cmd::before { content: "$"; color: var(--color-prompt); }
.cmd:hover { color: var(--color-link); }
.cmd:disabled { opacity: .5; cursor: default; }
/* The step's next action: its word in the text colour at strong weight, the green $ kept. On the
   code step that is $ sign in once six digits are in (the code's pattern makes its form valid). */
.cmd.next { color: var(--color-text); font-weight: var(--weight-strong); }
.ask.code:valid [type=submit] { color: var(--color-text); font-weight: var(--weight-strong); }
.cmd.next:hover { color: var(--color-link); }
.ask.code:valid [type=submit]:hover { color: var(--color-link); }

/* The × after the answered address, the site's mark for "remove this choice": muted, pink under
   the pointer, and back to the email step. Its tap area reaches past the small mark without moving
   the line; it stays on the address's last line. */
.answer .value { min-width: 0; }
.x { position: relative; display: inline; min-height: 0; margin-left: 1ch; padding: 0; border: 0; background: none;
  line-height: 1; color: var(--color-muted); cursor: pointer; transition: color var(--motion-duration) var(--motion-easing); }
.x::after { content: ""; position: absolute; top: -9px; right: -16px; bottom: -9px; left: -8px; }
.x:hover { color: var(--color-pink-text); }

/* A narrow phone puts the key above its value, as the website's rows do below 420px. */
@media (max-width: 420px) {
  .answer, .ask { grid-template-columns: minmax(0, 1fr); }
  .ask > label { margin-bottom: 4px; }
  .ask .commands { grid-column: 1; }
}
