/* Geist (Google Fonts, SIL Open Font License), served from this site itself: no requests to Google. */
@font-face {
  font-family: "Geist";
  src: url("fonts/geist.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --white: #ffffff;
  --subtle: #f5f6f8;
  --border: #e4e7ec;
  --ink: #111827;
  --secondary: #5b6472;
  --tertiary: #98a1ae;
  --blue: #2457e6;
  --blue-hover: #1c47c4;
  --blue-tint: #eef3fe;
  --green: #12a150;
  --green-tint: #ebf8f0;
  --red: #d92d20;
  --red-tint: #fdeceb;
  --amber-tint: #fff6e5;
  --radius: 8px;
  --radius-small: 6px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 15px/1.55 "Geist", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}
h1, h2, p, ol, dl, dd { margin: 0; }
b { font-weight: 550; color: var(--ink); }
a { color: var(--blue); text-underline-offset: 2px; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* All small line icons share one style */
.crumb-separator, .button svg, .help summary svg, .step-badge svg, .done-mark svg, .status svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.brand img { border-radius: 7px; }
.crumb-separator { width: 16px; height: 16px; color: var(--tertiary); }
.crumb { color: var(--secondary); }
.version { margin-left: auto; color: var(--secondary); font-size: 13px; font-variant-numeric: tabular-nums; }

/* Steps on the left, content on the right */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.steps { border-right: 1px solid var(--border); padding: 20px 12px; }
.steps ol { list-style: none; padding: 0; display: grid; gap: 2px; position: sticky; top: 20px; }
.steps button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  color: var(--secondary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.steps button:hover:not(:disabled) { background: var(--subtle); }
.steps button:disabled { cursor: default; }
.steps li[aria-current="step"] button { background: var(--subtle); color: var(--ink); font-weight: 550; }
.steps li.is-done button { color: var(--ink); }

.step-badge {
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.step-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; padding: 3px; display: none; }
li[aria-current="step"] .step-badge { border-color: var(--blue); background: var(--blue); color: var(--white); }
li.is-done .step-badge { border-color: var(--green); background: var(--green); color: var(--white); stroke-width: 2.5; }
li.is-done .step-badge span { display: none; }
li.is-done .step-badge svg { display: block; }

main { min-width: 0; padding: 40px 48px 72px; }
.panel { max-width: 720px; }

h1 { font-size: 26px; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; }
.intro { margin-top: 6px; color: var(--secondary); max-width: 60ch; }
h2 { font-size: 15px; line-height: 1.4; font-weight: 550; }
.section-title { margin: 32px 0 10px; }

/* Rows in a bordered box, divided by lines */
.rows { list-style: none; padding: 0; margin-top: 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.rows > * { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.rows > * + * { border-top: 1px solid var(--border); }
.rows > * > div { flex: 1; min-width: 0; }
.rows p { color: var(--secondary); margin-top: 2px; }
.section-title + .rows { margin-top: 0; }

.numbered > li { align-items: flex-start; }
.row-number {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: -1px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 550;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-small);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms;
}
.button svg { width: 16px; height: 16px; margin-right: -4px; }
.button.primary { background: var(--blue); color: var(--white); }
.button.primary:hover:not(:disabled) { background: var(--blue-hover); }
.button.secondary { background: var(--white); color: var(--ink); border-color: var(--border); }
.button.secondary:hover:not(:disabled) { background: var(--subtle); }
.button:disabled { background: var(--subtle); color: var(--tertiary); border-color: var(--border); cursor: default; }
.footer-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.footer-actions.back { justify-content: flex-start; }

/* Switch */
.toggle { cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--border); transition: background-color 150ms; }
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 150ms;
}
.toggle input:checked + .switch { background: var(--blue); }
.toggle input:checked + .switch::after { transform: translateX(16px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Messages */
.alert { margin-top: 16px; padding: 12px 16px; border: 1px solid; border-radius: var(--radius); }
.alert.problem, .alert[data-kind="problem"] { background: var(--red-tint); border-color: #f6c9c5; }
.alert[data-kind="done"] { background: var(--green-tint); border-color: #bfe8cf; }
.alert[data-kind="info"] { background: var(--blue-tint); border-color: #cddcfb; }

/* Progress: one row per check, with a status icon and a label */
.checks > li { align-items: flex-start; }
.status { flex: none; position: relative; width: 20px; height: 20px; margin-top: 1px; }
.status svg { position: absolute; inset: 0; width: 20px; height: 20px; display: none; }
.checks li[data-state="waiting"] .status-waiting,
.checks li[data-state="busy"] .status-busy,
.checks li[data-state="done"] .status-done,
.checks li[data-state="problem"] .status-problem { display: block; }
.status-waiting { color: var(--border); stroke-dasharray: 3 3.3; }
.status-busy { color: var(--blue); animation: spin 0.8s linear infinite; }
.status-done circle { fill: var(--green); stroke: none; }
.status-done path { stroke: var(--white); stroke-width: 2.25; }
.status-problem circle { fill: var(--red); stroke: none; }
.status-problem path { stroke: var(--white); stroke-width: 2.25; }

.checks li[data-state="waiting"] h2 { color: var(--secondary); font-weight: 450; }
.checks .detail:empty { display: none; }
.checks li[data-state="problem"] .detail { color: var(--ink); }

.label {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--radius-small);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 18px;
  white-space: nowrap;
}
[data-state="waiting"] .label { background: var(--subtle); color: var(--tertiary); }
[data-state="busy"] .label { background: var(--blue-tint); color: var(--blue); }
[data-state="done"] .label { background: var(--green-tint); color: var(--green); }
[data-state="problem"] .label { background: var(--red-tint); color: var(--red); }

.lock-form { margin-top: 16px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); }
.lock-form label { display: block; font-weight: 550; margin-bottom: 8px; }
.lock-row { display: flex; gap: 10px; }
.lock-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  font: inherit;
}
.lock-row input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }

/* Done */
.done-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 50%; background: var(--green-tint); color: var(--green); }
.done-mark svg { width: 24px; height: 24px; stroke-width: 2.25; }

/* Help */
.help { margin-top: 40px; border: 1px solid var(--border); border-radius: var(--radius); }
.help summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; cursor: pointer; font-weight: 550; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help summary svg { width: 18px; height: 18px; color: var(--secondary); transition: transform 150ms; }
.help[open] summary svg { transform: rotate(180deg); }
.help dl { padding: 4px 20px 18px; border-top: 1px solid var(--border); }
.help dt { margin-top: 14px; font-weight: 550; }
.help dd { color: var(--secondary); }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Tablets and narrow windows: the steps go across the top */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .steps { border-right: 0; border-bottom: 1px solid var(--border); padding: 8px 16px; overflow-x: auto; }
  .steps ol { display: flex; position: static; gap: 4px; }
  .steps button { padding: 0 10px; white-space: nowrap; }
  main { padding: 32px 24px 64px; }
}

/* Phones */
@media (max-width: 600px) {
  .topbar { padding: 0 16px; }
  .crumb, .crumb-separator { display: none; }
  .steps { padding: 8px 12px; }
  .steps li:not([aria-current="step"]) button { font-size: 0; gap: 0; padding: 0 8px; }
  main { padding: 24px 16px 56px; }
  h1 { font-size: 22px; }
  .rows > * { padding: 14px 16px; gap: 12px; }
  .rows > .row { flex-wrap: wrap; }
  .rows > .row > .button { width: 100%; }
  .checks .label { display: none; }
  .lock-row { flex-direction: column; }
  .footer-actions .button { flex: 1; }
}
