/* Used by every page: colours, text, the top bar, the page frame and cards.

   The look is soft and friendly: a near-white page with a trace of violet, deep ink, one violet
   for everything that can be pressed, and round corners. Titles, buttons and the product's name
   are set in a rounded face that the site serves itself, so every device shows the same one.
   Everything else is in the device's own font. */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/nunito-800.woff2") format("woff2");
}

:root {
  --ink: #1d1a3a;
  --muted: #676083;
  --line: #ece7f8;
  --line-strong: #d9d1ee;
  --page: #fbf9ff;
  --card: #ffffff;
  /* Links, focus rings and chosen controls. */
  --accent: #5b3df5;
  --accent-tint: #efeaff;
  --focus: rgb(91 61 245 / 0.2);
  /* A stroke of highlighter. Always behind ink. */
  --mark: #ffe27a;
  --link-line: #cfc5fb;
  --button: #5b3df5;
  --button-hover: #4a2de0;
  --button-ink: #ffffff;
  --placeholder: #a9a3bf;
  --danger: #b42318;
  --danger-line: #ecc5c1;
  --danger-tint: #fdf3f2;
  --ok: #1a7f4b;
  --ok-tint: #dff5e7;
  /* A dark panel, for code. */
  --panel: #1d1a3a;
  --panel-ink: #ecebf5;
  --panel-muted: #a29cc0;
  /* Cards, then fields and boxes inside them, then buttons, which are pills. */
  --radius: 24px;
  --radius-small: 12px;
  --radius-button: 999px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* The one weight the site serves is 800. */
  --font-display: "Nunito", ui-rounded, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

/* Without this, a class that sets "display" would show an element that has the hidden attribute. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

p {
  margin: 0 0 12px;
}

.hint {
  color: var(--muted);
  font-size: 0.875rem;
}

.message {
  font-size: 0.9rem;
}

.message.error {
  color: var(--danger);
}

.message.ok {
  color: var(--ok);
}

.top {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 20px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

/* The mark beside the name: a violet dot. */
.brand::before {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.5em;
  background: var(--accent);
  border-radius: 50%;
}

.account {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Lets a long email shrink and end in "…" instead of pushing "Log out" off the bar. */
  min-width: 0;
}

.account-email {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 20px 72px;
}

/* The login and signup pages: one small card in the middle. */
.page.narrow {
  max-width: 400px;
  padding-top: 12vh;
}

.page.narrow .brand {
  margin-bottom: 20px;
  text-align: center;
}

.page.narrow .below {
  margin-top: 20px;
  color: var(--muted);
  text-align: center;
}

.card {
  margin-bottom: 16px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* The card's own padding is the space below its last element. */
.card > :last-child,
.card form > :last-child {
  margin-bottom: 0;
}

.back {
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.back a {
  color: var(--muted);
}

.subtitle {
  margin: -14px 0 24px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .top-inner {
    padding: 10px 16px;
  }

  .account-email {
    display: none;
  }

  .page {
    padding: 24px 16px 56px;
  }

  .page.narrow {
    padding-top: 8vh;
  }

  .card {
    padding: 18px;
  }
}
