@font-face {
  font-family: "M PLUS 1 Code";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/m-plus-1-code-latin.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;
}

:root {
  color-scheme: light dark;
  --bg: light-dark(#f4f4f4, #000);
  --surface: light-dark(#fff, #141414);
  --text: light-dark(#171717, #f4f4f4);
  --muted: light-dark(#5c5c5c, #a3a3a3);
  --border: light-dark(#d6d6d6, #2a2a2a);
  --attention: light-dark(#c00, #ff3b30);
  --radius: 0rem;
  accent-color: var(--text);
}

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

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  min-height: 100dvh;
  font-family: "M PLUS 1 Code", ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
}

main {
  flex: 1;
  overflow: auto;
  overscroll-behavior: none;
  padding:
    calc(1rem + env(safe-area-inset-top, 0px))
    calc(1.25rem + env(safe-area-inset-right, 0px))
    calc(1.5rem + env(safe-area-inset-bottom, 0px))
    calc(1.25rem + env(safe-area-inset-left, 0px));
}

main:has(form) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

form {
  display: flex;
  flex-direction: column;
  width: max-content;
  max-width: 100%;
}

header {
  margin-bottom: 1.25rem;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

section {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
}

dl {
  margin: 0;
}

dt {
  margin: 0;
  color: var(--muted);
}

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

p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

p:first-child {
  margin-top: 0;
}

button,
a.action {
  display: inline-block;
  margin: 0.75rem 0.5rem 0 0;
  padding: 0.225rem 0.4rem;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  font: inherit;
  text-decoration: none;
  appearance: none;
  cursor: pointer;
  outline: none;
}

button::-moz-focus-inner {
  border: 0;
}

button:hover:not(:disabled),
a.action:hover {
  background: var(--bg);
  color: var(--text);
}

button:focus-visible,
a.action:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

form > button {
  align-self: flex-end;
  margin-right: 0;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

form > label:first-child {
  margin-top: 0;
}

input[type="text"],
input[type="password"] {
  box-sizing: content-box;
  width: 17ch;
  max-width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  appearance: none;
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--text);
}

p.error {
  margin: 0.5rem 0 0;
  color: var(--attention);
}
