:root {
  --ink: #16212b;
  --canvas: #f2f4f3;
  --surface: #ffffff;
  --rule: #d3dadc;
  --link: #1f5c99;
  --accent: #e3a600;
  --muted: #55626c;
  --danger: #b3261e;
  --font: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6ecef;
    --canvas: #0f161c;
    --surface: #18222b;
    --rule: #2c3943;
    --link: #7fb2e5;
    --muted: #9aa8b2;
    --danger: #f2b8b5;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
}

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 600;
  margin: 0;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Index */
.intro {
  margin-bottom: 2rem;
  max-width: 40rem;
}
.intro p {
  margin: 0;
  color: var(--muted);
}
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
}

/* Use-case card */
.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.card h2 a {
  color: var(--ink);
  text-decoration: none;
}
.card h2 a:hover {
  text-decoration: underline;
}
.card .description {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
}
.card .route {
  margin-top: auto;
}

/* Use-case page */
.use-case-description {
  max-width: 40rem;
  margin: 0 0 2rem;
}
.figures {
  margin-top: 1rem;
}

/* Figures drawn as stops on an amber route line */
.route {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
  border-left: 3px solid var(--accent);
}
.route li {
  position: relative;
  padding: 0.15rem 0 0.85rem;
}
.route li:last-child {
  padding-bottom: 0.15rem;
}
.route li::before {
  content: '';
  position: absolute;
  left: calc(-1.25rem - 7.5px);
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
}
.route a {
  font-weight: 600;
}

/* Figure page: a bar back to all use cases, and the report filling the rest of the window */
.figure-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
.figure-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.figure-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding: 0.5rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.figure-back {
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.figure-bar h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.figure-session {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}
.figure-frame {
  flex: 1;
  width: 100%;
  border: 0;
}
@media (max-width: 60rem) {
  /* Narrower than a laptop: the way back and Sign out on one row, the title on the next.
     Change password stays on every other page */
  .figure-bar {
    padding: 0.5rem 1rem;
  }
  .figure-back {
    flex: 1 1 0;
  }
  .figure-session > span,
  .figure-session > a {
    display: none;
  }
  .figure-bar h1 {
    order: 1;
    flex-basis: 100%;
  }
}

/* Signed-in bar */
.session {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1.5rem 0;
  font-size: 0.9375rem;
  color: var(--muted);
}
.session form,
.figure-session form {
  margin: 0;
}
.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* Sign-in page */
.sign-in {
  max-width: 24rem;
  margin: 2rem auto 0;
}
.sign-in-intro,
.sign-in-help {
  color: var(--muted);
}
.sign-in-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.sign-in-form label {
  font-weight: 600;
}
.sign-in-form input {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.sign-in-form button {
  margin-top: 0.25rem;
  padding: 0.6rem 1rem;
  font: 600 1rem/1.2 var(--font);
  color: #16212b;
  background: var(--accent);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.sign-in-form input:focus-visible,
.sign-in-form button:focus-visible,
.link-button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.form-error {
  padding: 0.75rem 1rem;
  color: var(--danger);
  border: 1px solid currentColor;
  border-radius: 4px;
}
.field-help {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}
