/* The site's one stylesheet. Plain on purpose: the look gets its own pass
   later, and until then every page should simply be easy to read and use. */

:root {
  color-scheme: light dark;
  --paper: #faf9f6;
  --ink: #17171b;
  --muted: #6a6a75;
  --line: #d9d7d0;
  --field: #ffffff;
  --accent: #17171b;
  --on-accent: #faf9f6;
  --danger: #b3261e;
  --notice: #efece4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121214;
    --ink: #f2f1ec;
    --muted: #9c9ca8;
    --line: #34343b;
    --field: #1b1b1f;
    --accent: #f2f1ec;
    --on-accent: #121214;
    --danger: #ff8a80;
    --notice: #1f1f24;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

a { color: inherit; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

.site-header,
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1rem;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
}

.site-name { font-weight: 700; text-decoration: none; }

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
}

.site-header form { margin: 0; }
.site-footer { color: var(--muted); font-size: 0.875rem; margin-top: auto; }

main {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

main.wide { max-width: 44rem; }

main.centered {
  flex: 1;
  display: grid;
  place-content: center;
}

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 0.25rem; }
p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.25rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.muted { color: var(--muted); }
section + section { border-top: 1px solid var(--line); margin-top: 1.5rem; }

/* Forms */

form { margin: 0 0 1rem; }
.field { margin: 0 0 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.25rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input:not([type]),
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 6px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.field-check { display: flex; align-items: flex-start; gap: 0.6rem; }
.field-check input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.field-check label { font-weight: 400; margin: 0; }

.help { color: var(--muted); font-size: 0.875rem; margin: 0.25rem 0 0; }
.help ul { margin: 0; }

.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.5rem;
  color: var(--danger);
  font-size: 0.9rem;
}

button,
.button {
  display: inline-block;
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}

button.quiet,
.button.quiet {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

button.danger,
.button.danger {
  color: var(--paper);
  background: var(--danger);
  border-color: var(--danger);
}

button.link {
  padding: 0;
  font-weight: 400;
  color: inherit;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.providers { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.providers form { margin: 0; }
.providers button { width: 100%; }

/* Notes from the site after an action, and standing notices. */

.messages { list-style: none; padding: 0; margin: 0 0 1.5rem; }

.messages li,
.notice {
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.5rem;
  background: var(--notice);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.messages li.error { border-color: var(--danger); }

/* Lists of settings, one row each. */

.rows { list-style: none; padding: 0; margin: 0; }

.rows li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

.rows li:first-child { border-top: 0; }
.rows form { margin: 0; }

table { border-collapse: collapse; width: 100%; margin: 0 0 1rem; }
th, td { text-align: left; vertical-align: top; padding: 0.4rem 0.75rem 0.4rem 0; }
th { border-bottom: 1px solid var(--line); }

/* The QR code for an authenticator app is drawn in black, so it gets a white
   card of its own in the dark theme as well. */
img[src^="data:image/svg"] { background: #fff; padding: 0.5rem; border-radius: 6px; max-width: 14rem; }

mark { background: transparent; color: var(--danger); border-bottom: 1px dashed var(--danger); }
