/* The page stands apart from the editor's bundle, so it brings the weights it uses */
@font-face { font-family: "PP Mori"; src: url("./fonts/PPMori-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PP Mori"; src: url("./fonts/PPMori-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "PP Mori"; src: url("./fonts/PPMori-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PP Mori"; src: url("./fonts/PPMori-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light dark;
  --background: #efefef;
  --card: #fcfcfc;
  --border: #e2e2e2;
  --text: #121212;
  --text-secondary: #5a5a5a;
  --accent: #5a45e8;
  --accent-text: #5a45e8;
  --control: #e2e2e2;
  --problem: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #121212;
    --card: #1c1c1c;
    --border: #2a2a2a;
    --text: #f7f7f7;
    --text-secondary: #a8a8a8;
    --accent-text: #a597ff;
    --control: #2a2a2a;
    --problem: #ffb4ab;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 16px/1.5 "PP Mori", ui-sans-serif, system-ui, sans-serif;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 64px 16px 32px;
}

.icon { display: block; margin-bottom: 24px; }

.badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--control);
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
}

h1 { margin: 0 0 8px; font-size: 40px; line-height: 48px; font-weight: 700; }
h2 { margin: 0 0 8px; font-size: 18px; line-height: 24px; font-weight: 600; }
.lead { margin: 0 0 32px; font-size: 18px; color: var(--text-secondary); }
.meta { margin: 8px 0 0; font-size: 14px; color: var(--text-secondary); }

section {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}

section p, ol, ul { margin: 0; color: var(--text-secondary); }
ol, ul { padding-left: 24px; }
li + li { margin-top: 4px; }
.note { margin-top: 16px; }

.button {
  display: inline-flex;
  align-items: center;
  /* At least 44 high; a long label (German on a phone) wraps onto a second line inside the button */
  min-height: 44px;
  margin-top: 16px;
  padding: 8px 16px;
  line-height: 24px;
  border-radius: 8px;
  background: var(--control);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.button { border: 0; font-family: inherit; cursor: pointer; transition: filter 150ms; }
.button:hover { filter: brightness(1.1); }
.button:disabled { opacity: 0.5; cursor: default; }
.button.primary { margin-top: 0; background: var(--accent); color: #fff; }
.button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, .fallback:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.started { color: var(--accent-text); font-weight: 500; }

/* The one card that asks for something: the accent's border and a trace of its colour */
.pro {
  scroll-margin-top: 16px;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
}

form { margin-top: 16px; }
[hidden] { display: none !important; }
label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.field { display: flex; flex-wrap: wrap; gap: 8px; }

input {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--text-secondary);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}

input[aria-invalid="true"] { border-color: var(--problem); }
section p.problem { margin-top: 8px; color: var(--problem); font-size: 14px; }
section p.fine { margin-top: 12px; font-size: 14px; line-height: 20px; }
.fine a { color: var(--accent-text); }

.fallback {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.outcome, section p.outcome { margin-top: 16px; color: var(--text); font-weight: 500; }
.outcome p { color: var(--text); outline: none; }


footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  font-size: 14px;
  color: var(--text-secondary);
}

footer a { color: var(--accent-text); text-decoration: none; }

select {
  min-height: 44px;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
