/* The login form is served before the workspace stylesheet is available. */
:root {
  color-scheme: dark;
  --workspace: #131e19;
  --paper: #1c2a23;
  --ink: #e6eee7;
  --line: #35463c;
  --field-border: #708575;
  --focus: #a4d795;
  --action: #abd58f;
  --action-hover: #bce8a1;
  --on-action: #192916;
  --error-bg: #412820;
  --error-ink: #ffbba8;
}

:root[data-theme="light"] {
  color-scheme: light;
  --workspace: #f6f7f4;
  --paper: #fff;
  --ink: #202e2b;
  --line: #dfe5de;
  --field-border: #637669;
  --focus: #4e8c72;
  --action: #1c654e;
  --action-hover: #114d3b;
  --on-action: #fff;
  --error-bg: #faece8;
  --error-ink: #913b2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--workspace);
  color: var(--ink);
  font: 1rem system-ui, sans-serif;
}

main {
  width: min(100%, 25rem);
  background: var(--paper);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.brand {
  font-size: 1.35rem;
  font-weight: 750;
  margin: 0 0 2rem;
}

.brand span {
  font-weight: 450;
}

form {
  display: grid;
  gap: .45rem;
}

label {
  font-weight: 600;
}

input,
button {
  font: inherit;
  border-radius: .45rem;
  padding: .65rem .8rem;
}

input {
  width: 100%;
  margin-bottom: .75rem;
  border: 1px solid var(--field-border);
  background: var(--paper);
  color: var(--ink);
  caret-color: var(--focus);
}

button {
  color: var(--on-action);
  background: var(--action);
  border: none;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: var(--action-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: var(--action);
  color: var(--on-action);
}

.error {
  margin: 0 0 .75rem;
  padding: .65rem .8rem;
  border-radius: .45rem;
  background: var(--error-bg);
  color: var(--error-ink);
}

h2 {
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 0 0 .5rem;
}

.hint {
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.mfa-qr {
  display: block;
  width: min(100%, 16.5rem);
  height: auto;
  margin: 1rem auto;
  padding: 1.25rem;
  background: white;
  border-radius: .45rem;
  image-rendering: pixelated;
}

details {
  margin-bottom: 1.5rem;
}

summary, .start-over {
  color: var(--action);
  cursor: pointer;
}

#setup-key {
  display: block;
  margin-top: .65rem;
  overflow-wrap: anywhere;
  user-select: all;
}

#code {
  font-variant-numeric: tabular-nums;
  letter-spacing: .2em;
}

.start-over {
  display: block;
  margin-top: 1rem;
  text-align: center;
  text-underline-offset: .2em;
}
