/*
 * SPDX-License-Identifier: EUPL-1.2
 * Copyright © 2026 Omar Venturi
 *
 * Fermate for the pages rendered by the server: signing in, invitations, «I miei dati», the
 * portal and the error pages. The tokens are the ones of the management area
 * (frontend/src/theme/fermate.css), copied unchanged: a test keeps the two lists equal.
 * The fonts are the Latin subsets of Lexend and Atkinson Hyperlegible (SIL Open Font
 * License 1.1, licences beside the files). Themes: the system preference, unless
 * data-theme="light" or "dark" is set on <html>.
 */

/* ---------- Fonts ---------- */

/* lexend-latin-ext-500-normal */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fonts/lexend/lexend-latin-ext-500-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* lexend-latin-500-normal */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fonts/lexend/lexend-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* lexend-latin-ext-600-normal */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(fonts/lexend/lexend-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* lexend-latin-600-normal */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(fonts/lexend/lexend-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* lexend-latin-ext-700-normal */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/lexend/lexend-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* lexend-latin-700-normal */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/lexend/lexend-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* atkinson-hyperlegible-latin-ext-400-normal */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* atkinson-hyperlegible-latin-400-normal */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* atkinson-hyperlegible-latin-ext-400-italic */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-400-italic.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* atkinson-hyperlegible-latin-400-italic */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-400-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* atkinson-hyperlegible-latin-ext-700-normal */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* atkinson-hyperlegible-latin-700-normal */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ---------- Tokens: keep identical to the management area ---------- */

:root {
  color-scheme: light;

  --fm-background: #edf0f3;
  --fm-surface: #ffffff;
  --fm-ink: #1a1d22;
  --fm-muted: #4d5560;
  --fm-rule-subtle: #d3d9e0;
  --fm-rule: #737c88;
  --fm-action: #222b36;
  --fm-action-hover: #364252;
  --fm-on-action: #ffffff;
  --fm-action-subtle: #dde3ea;
  --fm-signal: #f7d35e;
  --fm-on-signal: #1a1d22;
  --fm-highlight: #f7d35e;
  --fm-hint: #fdf6d8;
  --fm-stop: #ffffff;
  --fm-track-day: #9aa3ae;
  --fm-line-1: #c8102e;
  --fm-on-line-1: #ffffff;
  --fm-line-2: #00843d;
  --fm-on-line-2: #ffffff;
  --fm-line-3: #e35205;
  --fm-on-line-3: #101215;
  --fm-focus: #1a1d22;
  --fm-halo: #f7d35e;
  --fm-shadow: 0 1px 2px rgba(26, 29, 34, 0.06), 0 8px 24px rgba(26, 29, 34, 0.07);
  --fm-shadow-strong: 0 2px 4px rgba(26, 29, 34, 0.08), 0 18px 48px rgba(26, 29, 34, 0.18);

  --fm-font-headings: 'Lexend', 'Trebuchet MS', system-ui, sans-serif;
  --fm-font-text: 'Atkinson Hyperlegible', Verdana, system-ui, sans-serif;
  --fm-column: 46rem;
  --fm-radius: 24px;
  --fm-radius-control: 16px;
  --fm-target: 44px;

  /* Line geometry: indent, track centre, track width, stop diameter, stop centre. */
  --fm-line-indent: 32px;
  --fm-track-centre: 14px;
  --fm-track-width: 6px;
  --fm-stop-size: 24px;
  --fm-stop-centre: 24px;
}

@media (min-width: 700px) {
  :root {
    --fm-line-indent: 40px;
    --fm-track-centre: 16px;
    --fm-track-width: 8px;
    --fm-stop-size: 28px;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --fm-background: #12161b;
    --fm-surface: #1b2027;
    --fm-ink: #eef1f5;
    --fm-muted: #b4bcc7;
    --fm-rule-subtle: #333b46;
    --fm-rule: #8a94a2;
    --fm-action: #e4e9ef;
    --fm-action-hover: #ffffff;
    --fm-on-action: #12161b;
    --fm-action-subtle: #2a313b;
    --fm-signal: #ebc85a;
    --fm-on-signal: #12161b;
    --fm-highlight: #6d5a12;
    --fm-hint: #2d2a1a;
    --fm-stop: #1b2027;
    --fm-track-day: #5d6672;
    --fm-line-1: #ff7385;
    --fm-on-line-1: #12161b;
    --fm-line-2: #3ddc84;
    --fm-on-line-2: #12161b;
    --fm-line-3: #ff8a3d;
    --fm-on-line-3: #12161b;
    --fm-focus: #f7d35e;
    --fm-halo: transparent;
    --fm-shadow: none;
    --fm-shadow-strong: 0 18px 48px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --fm-background: #12161b;
  --fm-surface: #1b2027;
  --fm-ink: #eef1f5;
  --fm-muted: #b4bcc7;
  --fm-rule-subtle: #333b46;
  --fm-rule: #8a94a2;
  --fm-action: #e4e9ef;
  --fm-action-hover: #ffffff;
  --fm-on-action: #12161b;
  --fm-action-subtle: #2a313b;
  --fm-signal: #ebc85a;
  --fm-on-signal: #12161b;
  --fm-highlight: #6d5a12;
  --fm-hint: #2d2a1a;
  --fm-stop: #1b2027;
  --fm-track-day: #5d6672;
  --fm-line-1: #ff7385;
  --fm-on-line-1: #12161b;
  --fm-line-2: #3ddc84;
  --fm-on-line-2: #12161b;
  --fm-line-3: #ff8a3d;
  --fm-on-line-3: #12161b;
  --fm-focus: #f7d35e;
  --fm-halo: transparent;
  --fm-shadow: none;
  --fm-shadow-strong: 0 18px 48px rgba(0, 0, 0, 0.55);
}


/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fm-background);
  color: var(--fm-ink);
  font-family: var(--fm-font-text);
  font-size: 1.1875rem;
  line-height: 1.55;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--fm-font-headings);
  font-weight: 600;
  color: var(--fm-ink);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

h2 {
  margin: 32px 0 12px;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h3 {
  margin: 24px 0 8px;
  font-size: 1.25rem;
  line-height: 1.3;
}

p {
  margin: 0 0 16px;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 1.25em;
}

li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

a {
  color: var(--fm-ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

:focus-visible {
  outline: 3px solid var(--fm-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--fm-halo);
}

.intro,
.muted {
  color: var(--fm-muted);
}

.intro {
  font-size: 1.25rem;
}

/* ---------- Layouts: a narrow card for signing in, a column for the portal ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 8px 0 22px;
  font: 700 1.625rem/1 var(--fm-font-headings);
  letter-spacing: -0.04em;
}

.brand__stop {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 6px solid var(--fm-ink);
  background: var(--fm-signal);
}

.brand__place {
  overflow: hidden;
  font: 400 1rem/1.3 var(--fm-font-text);
  letter-spacing: 0;
  color: var(--fm-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell {
  max-width: 34rem;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.card {
  padding: 26px 20px;
  border-radius: var(--fm-radius);
  background: var(--fm-surface);
  box-shadow: var(--fm-shadow);
}

@media (min-width: 600px) {
  .shell {
    padding-top: 40px;
  }

  .card {
    padding: 34px 32px;
  }
}

.page {
  max-width: var(--fm-column);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.page > header {
  padding: 8px 0 20px;
}

.page > main {
  padding: 26px 20px;
  border-radius: var(--fm-radius);
  background: var(--fm-surface);
  box-shadow: var(--fm-shadow);
}

@media (min-width: 600px) {
  .page {
    padding-top: 40px;
  }

  .page > main {
    padding: 34px 32px;
  }
}

.page > footer,
.footer {
  margin-top: 28px;
  font-size: 1rem;
  color: var(--fm-muted);
}

main > :last-child {
  margin-bottom: 0;
}

section + section {
  margin-top: 8px;
  border-top: 2px solid var(--fm-rule-subtle);
}

/* ---------- Commands ---------- */

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin: 0 0 12px;
  padding: 10px 22px;
  border: 3px solid var(--fm-action);
  border-radius: var(--fm-radius-control);
  background: var(--fm-action);
  color: var(--fm-on-action);
  font: 600 1.1875rem/1.2 var(--fm-font-headings);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--fm-action-hover);
  border-color: var(--fm-action-hover);
}

.button--quiet {
  background: var(--fm-surface);
  color: var(--fm-ink);
}

.button--quiet:hover {
  background: var(--fm-action-subtle);
  border-color: var(--fm-action);
}

.links {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.links li {
  margin: 0;
}

.links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--fm-target);
  min-width: var(--fm-target);
  font-weight: 700;
}

/* ---------- Forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 18px;
}

.field label,
.field__label {
  font-weight: 700;
}

/* A value given, not typed: the address an invitation was sent to. */
.field__value {
  padding: 12px 16px;
  border-radius: var(--fm-radius-control);
  background: var(--fm-background);
  overflow-wrap: anywhere;
}

.field input {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 10px 16px;
  border: 2px solid var(--fm-rule);
  border-radius: var(--fm-radius-control);
  background: var(--fm-surface);
  color: var(--fm-ink);
  font: inherit;
}

.field input:focus-visible {
  border-color: var(--fm-action);
}

.field input[aria-invalid='true'] {
  border-color: var(--fm-line-1);
}

/* What accepting means, under the buttons that accept. */
.consent {
  margin: 14px 0 0;
  font-size: 1rem;
  color: var(--fm-muted);
}

.field__hint {
  margin: 0;
  font-size: 1rem;
  color: var(--fm-muted);
}

.field__error {
  margin: 0;
  padding-left: 10px;
  border-left: 6px solid var(--fm-line-1);
  font-weight: 700;
}

.field label:has(input[type='checkbox']) {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--fm-target);
}

.field input[type='checkbox'] {
  flex: none;
  width: 26px;
  height: 26px;
  min-height: 0;
  accent-color: var(--fm-action);
}

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 18px;
  color: var(--fm-muted);
}

.or::before,
.or::after {
  content: '';
  flex: 1;
  border-top: 2px solid var(--fm-rule-subtle);
}

details {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 2px solid var(--fm-rule-subtle);
}

summary {
  display: flex;
  align-items: center;
  min-height: var(--fm-target);
  margin-bottom: 8px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Messages, labels, data ---------- */

.message {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 6px solid var(--fm-line-2);
  border-radius: 14px;
  background: var(--fm-background);
}

.message > :last-child {
  margin-bottom: 0;
}

.message--error {
  border-left-color: var(--fm-line-1);
}

/* A role: a word on a flat tile, never shaped like a button. */
.role {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 3px 12px;
  border-radius: 8px;
  background: var(--fm-action-subtle);
  color: var(--fm-ink);
  font: 700 1rem/1.2 var(--fm-font-text);
  white-space: nowrap;
}

.role--manager {
  background: var(--fm-signal);
  color: var(--fm-on-signal);
}

dl {
  margin: 0 0 16px;
}

/* The details of an invitation stand apart, like a ticket: the role first, then the place. */
.eyebrow {
  margin: 0 0 6px;
  font: 600 1.0625rem/1.3 var(--fm-font-headings);
  color: var(--fm-muted);
}

/* The name of the place leads to its portal: a target of 44 px that takes no more room. */
.eyebrow a {
  display: inline-flex;
  align-items: center;
  min-height: var(--fm-target);
  margin: calc((1.3em - var(--fm-target)) / 2) 0;
  color: inherit;
}

.ticket {
  display: grid;
  margin: 22px 0;
  padding: 2px 18px;
  border: 2px dashed var(--fm-rule);
  border-radius: 18px;
}

.ticket__row {
  display: grid;
  grid-template-columns: minmax(0, 8rem) minmax(0, 1fr);
  gap: 4px 16px;
  align-items: center;
  padding: 12px 0;
}

.ticket__row + .ticket__row {
  border-top: 2px solid var(--fm-rule-subtle);
}

.ticket dt {
  color: var(--fm-muted);
}

.ticket dd {
  margin: 0;
  font: 600 1.1875rem/1.3 var(--fm-font-headings);
  overflow-wrap: anywhere;
}

.ticket .role {
  min-height: 40px;
  padding: 4px 14px;
  font-size: 1.125rem;
}

@media (max-width: 420px) {
  .ticket__row {
    grid-template-columns: minmax(0, 1fr);
  }
}

dt {
  font-weight: 700;
}

dd {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.secret {
  font: 700 1.125rem/1.6 ui-monospace, Consolas, monospace;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.codes {
  columns: 2;
  padding-left: 1.25rem;
  font: 700 1rem/1.8 ui-monospace, Consolas, monospace;
}

.qr {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  padding: 8px;
  border-radius: 12px;
  /* The code must stay dark on white to be read, in both themes. */
  background: #ffffff;
}

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }
}

/* ---------- First access: the line of its steps, the drawings, the ways to choose ---------- */

/* The card with a band reaches its edges: the band cuts its drawing. */
.card--illustrated {
  overflow: hidden;
}

.band {
  position: relative;
  height: 128px;
  margin: -26px -20px 24px;
  overflow: hidden;
  background: var(--fm-hint);
}

.band svg {
  position: absolute;
  right: -26px;
  bottom: -62px;
  width: 210px;
  height: 210px;
  fill: none;
  stroke: var(--fm-ink);
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.band .band__fill {
  fill: var(--fm-signal);
}

.band .band__light {
  fill: var(--fm-surface);
}

.band .band__ground {
  fill: var(--fm-hint);
}

.band .band__ink {
  fill: var(--fm-ink);
}

.band .band__dot {
  fill: var(--fm-ink);
  stroke: none;
}

/* The four stripes of the lifebuoy fill the ring between its two circles. */
.band .band__stripe {
  stroke: var(--fm-signal);
  stroke-width: 5;
  stroke-linecap: butt;
}

.band--key svg {
  bottom: -41px;
}

.band--fingerprint svg,
.band--lifebuoy svg {
  right: -44px;
  bottom: -78px;
}

@media (min-width: 600px) {
  .band {
    height: 150px;
    margin: -34px -32px 28px;
  }

  .band svg {
    right: -24px;
    bottom: -104px;
    width: 300px;
    height: 300px;
  }

  .band--key svg {
    bottom: -75px;
  }

  .band--fingerprint svg,
  .band--lifebuoy svg {
    right: -52px;
    bottom: -124px;
  }
}

/* The steps: stops on a short line; the optional one is reached by a dotted track. */
.steps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.steps__stop {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
  margin: 0;
  text-align: center;
  font: 600 0.9375rem/1.2 var(--fm-font-headings);
  color: var(--fm-muted);
}

.steps__stop:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 9px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 6px;
  border-radius: 3px;
  background: var(--fm-action);
}

.steps__stop.is-here:not(:last-child)::after,
.steps__stop.is-later:not(:last-child)::after {
  background: var(--fm-rule-subtle);
}

.steps__stop:has(+ .is-optional.is-later)::after {
  background: repeating-linear-gradient(90deg, var(--fm-rule) 0 8px, transparent 8px 14px);
}

.steps__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 5px solid var(--fm-rule);
  background: var(--fm-surface);
}

.steps__stop.is-done .steps__dot {
  border-color: var(--fm-action);
  background: var(--fm-action);
}

.steps__stop.is-done .steps__dot::after {
  content: '';
  width: 8px;
  height: 4px;
  margin-top: -2px;
  border-left: 2.5px solid var(--fm-on-action);
  border-bottom: 2.5px solid var(--fm-on-action);
  transform: rotate(-45deg);
}

.steps__stop.is-here {
  color: var(--fm-ink);
}

.steps__stop.is-here .steps__dot {
  border-color: var(--fm-ink);
  background: var(--fm-signal);
}

.steps__stop small {
  display: block;
  font: 400 0.8125rem/1.2 var(--fm-font-text);
  color: var(--fm-muted);
}

/* On a phone five stops leave no room for their names: the dots stay, with the place where you
   are written below them. The names remain for screen readers. */
.steps__caption {
  display: none;
}

@media (max-width: 599px) {
  .steps--long {
    margin-bottom: 12px;
  }

  .steps--long .steps__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .steps__caption {
    display: block;
    margin: 0 0 26px;
    text-align: center;
    font: 600 0.9375rem/1.3 var(--fm-font-headings);
    color: var(--fm-muted);
  }

  .steps__caption strong {
    color: var(--fm-ink);
  }
}

/* The two steps announced, as stops in a column. */
.plan {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.plan li {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0 0 18px;
}

.plan li:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 24px;
  bottom: 0;
  left: 9px;
  width: 6px;
  border-radius: 3px;
  background: var(--fm-rule-subtle);
}

.plan li:last-child {
  padding-bottom: 0;
}

.plan p {
  margin: 0;
}

.plan__dot {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  border: 5px solid var(--fm-ink);
  background: var(--fm-surface);
}

.plan li:first-child .plan__dot {
  background: var(--fm-signal);
}

.plan strong {
  display: block;
  font: 600 1.1875rem/1.3 var(--fm-font-headings);
}

.plan span:not(.optional) {
  color: var(--fm-muted);
}

.optional {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-left: 6px;
  padding: 1px 10px;
  border-radius: 8px;
  background: var(--fm-action-subtle);
  color: var(--fm-ink);
  font: 600 0.8125rem/1 var(--fm-font-headings);
  vertical-align: 3px;
}

/* A step done, with a green check. */
.success {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0 0 24px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--fm-background);
}

.success__dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--fm-line-2);
}

.success__dot::after {
  content: '';
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border-left: 3px solid var(--fm-on-line-2);
  border-bottom: 3px solid var(--fm-on-line-2);
  transform: rotate(-45deg);
}

.success p {
  margin: 0;
}

.success strong {
  display: block;
  font: 600 1.1875rem/1.3 var(--fm-font-headings);
}

/* The ways to make a profile safer, as tabs. */
.tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: var(--fm-radius-control);
  background: var(--fm-action-subtle);
}

.tabs[hidden] {
  display: none;
}

.tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--fm-target);
  padding: 6px 10px;
  border: 0;
  border-radius: calc(var(--fm-radius-control) - 4px);
  background: transparent;
  color: var(--fm-ink);
  font: 600 1rem/1.2 var(--fm-font-headings);
  text-wrap: balance;
  cursor: pointer;
}

.tabs button:hover {
  background: var(--fm-surface);
}

.tabs button[aria-selected='true'] {
  background: var(--fm-action);
  color: var(--fm-on-action);
}

.tab-panel {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin: 0 0 22px;
  padding: 20px 18px;
  border: 2px solid var(--fm-rule-subtle);
  border-radius: 20px;
}

section.tab-panel + section.tab-panel {
  margin-top: 0;
  border-top: 2px solid var(--fm-rule-subtle);
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel__drawing {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--fm-hint);
  color: var(--fm-ink);
}

.tab-panel__drawing svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-panel h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.tab-panel p {
  margin: 0 0 14px;
}

.tab-panel .button {
  margin: 0;
}

.tab-panel .tab-panel__note {
  margin: 12px 0 0;
  font-size: 0.9375rem;
  color: var(--fm-muted);
}

@media (max-width: 420px) {
  .tab-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

.later {
  padding-top: 20px;
  border-top: 2px solid var(--fm-rule-subtle);
}

.later .button {
  margin-bottom: 8px;
}

.later p {
  margin: 0;
  font-size: 1rem;
  color: var(--fm-muted);
}

/* Linking the authenticator app: three numbered steps. */
.instructions {
  margin: 0 0 20px;
  padding-left: 1.5em;
}

.instructions li {
  margin: 0 0 14px;
  padding-left: 4px;
}

.instructions li::marker {
  font: 700 1.0625rem var(--fm-font-headings);
}

.instructions .qr {
  margin: 10px 0 0;
}

.instructions .field {
  margin: 10px 0 0;
}

.reveal {
  margin: 10px 0 0;
  padding-top: 0;
  border-top: 0;
  font-size: 1rem;
}

.reveal summary {
  display: inline-flex;
  margin-bottom: 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* A field with its own button beside, such as «Show» for a password. */
.field__with-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.field__show {
  min-width: 96px;
  min-height: 56px;
  border: 2px solid var(--fm-rule);
  border-radius: var(--fm-radius-control);
  background: var(--fm-surface);
  color: var(--fm-ink);
  font: 600 1rem var(--fm-font-headings);
  cursor: pointer;
}

.field__show[hidden] {
  display: none;
}
