/*
 * updatewatch signing page. Same tokens as the dashboard; one thing is
 * different on purpose: the list of jobs is the page. It is set large,
 * so that what is signed is what is read.
 */

:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #566473;
  --line: #d3dae1;
  --accent: #0d6674;
  --on-accent: #ffffff;
  --red: #b3261a;
  --amber: #8f5a00;
  --wash-amber: #fbf1dc;
  --font-sign: Bahnschrift, "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Noto Sans Condensed",
    "Liberation Sans Narrow", "Arial Narrow", system-ui, sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", sans-serif;
  --font-code: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --bar: 5px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151b;
    --surface: #161e27;
    --ink: #e6ecf2;
    --muted: #94a2b0;
    --line: #2a3541;
    --accent: #5cc4d2;
    --on-accent: #06222a;
    --red: #ff8f80;
    --amber: #e9b352;
    --wash-amber: #33270f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.5 var(--font-text); }
a { color: var(--accent); text-underline-offset: 0.15em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.masthead {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem;
  padding: 0.75rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line);
  border-top: var(--bar) solid var(--accent);
}
.brand { font: 600 1.25rem/1.2 var(--font-sign); font-stretch: 87.5%; }
.where { color: var(--muted); font-size: 0.9375rem; }

main { max-width: 52rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
h1 { font: 600 clamp(1.625rem, 1.2rem + 1.8vw, 2.25rem)/1.2 var(--font-sign); font-stretch: 87.5%; margin: 0 0 0.75rem; text-wrap: balance; }
.prose, .lead { max-width: 68ch; }
.lead { font-size: 1.125rem; margin-top: 0; }
code, pre { font-family: var(--font-code); font-size: 0.875em; }
.hex { overflow-wrap: anywhere; }
pre { margin: 0.75rem 0; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* The jobs: one numbered line each, the host first and large. */
.job-list { list-style: none; counter-reset: job; margin: 1.5rem 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-left: var(--bar) solid var(--accent); }
.job-list li { counter-increment: job; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0 0.5rem; padding: 0.75rem 1rem 0.75rem 0.5rem; border-bottom: 1px solid var(--line); }
.job-list li:last-child { border-bottom: 0; }
.job-list li::before { content: counter(job) "."; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.job-host { font: 600 1.375rem/1.25 var(--font-sign); font-stretch: 87.5%; overflow-wrap: anywhere; }
.job-what { grid-column: 2; }
.job-what code { font-size: 1rem; }

.warning { max-width: 68ch; padding: 0.5rem 0.75rem; border-left: var(--bar) solid var(--amber); background: var(--wash-amber); }
details { margin-top: 2rem; }
summary { cursor: pointer; color: var(--accent); }

button, input, a.button { font: inherit; color: inherit; }
button, a.button { display: inline-block; padding: 0.5rem 1rem; background: var(--surface); border: 1px solid var(--muted); border-radius: 3px; cursor: pointer; text-decoration: none; }
button.primary, a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
#approve-button { font-size: 1.125rem; padding: 0.625rem 1.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

label { display: block; font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.25rem; }
input { width: 100%; max-width: 24rem; padding: 0.5rem 0.625rem; background: var(--surface); border: 1px solid var(--muted); border-radius: 3px; }
form.inline { display: grid; grid-template-columns: minmax(0, 24rem) auto; gap: 0.25rem 0.75rem; justify-content: start; align-items: end; }
form.inline label { grid-column: 1 / -1; margin: 0; }

.result { margin-top: 1.5rem; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-left: var(--bar) solid var(--accent); }
.key-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.25rem 1rem; margin: 0; }
.key-facts div { display: contents; }
.key-facts dt { color: var(--muted); }
.key-facts dd { margin: 0; overflow-wrap: anywhere; }
.steps { padding-left: 1.25rem; }

[role="status"] { margin: 0.75rem 0; max-width: 68ch; }
[role="status"]:empty { margin: 0; }
[role="status"].error { color: var(--red); font-weight: 600; }
[role="status"].done { color: var(--accent); font-weight: 600; }

@media (max-width: 40rem) {
  form.inline { grid-template-columns: minmax(0, 1fr); }
  .job-list li { grid-template-columns: 1.75rem minmax(0, 1fr); }
}
