/* hOSSter portal. One file, no build step.
   Contents: 1 tokens, 2 base, 3 layout, 4 forms and buttons, 5 components.
   To restyle, change the tokens; nothing below them names a colour or a font.
   The tokens and the base rules are the same as in site/src/assets/site.css,
   so the site and the portal read as one product. Change a token in both files. */

/* 1. Tokens */
:root {
  color-scheme: light dark;
  --color-bg: #fdfdfb;
  --color-text: #1f2326;
  --color-muted: #5f676d;
  --color-rule: #dcdfdd;
  --color-code: #f1f2ef;
  --color-link: #1d6656;
  --color-warn: #7d5200;
  --color-bad: #a3271f;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-sm: 0.9rem;
  --width: 40rem;
  --gutter: 1.25rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #161a1d;
    --color-text: #dfe3e5;
    --color-muted: #98a2a9;
    --color-rule: #343c42;
    --color-code: #20262a;
    --color-link: #74c4ae;
    --color-warn: #e2b55a;
    --color-bad: #f08a80;
  }
}

/* 2. Base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 1rem/1.65 var(--font-body);
}
h1, h2 { line-height: 1.3; font-weight: 650; overflow-wrap: break-word; }
h1 { font-size: 1.6rem; margin: 0 0 1.25rem; }
h2 { font-size: 1.2rem; margin: 2.5rem 0 0.75rem; }
p, ol, ul, dl { margin: 0 0 1rem; }
ol, ul { padding-left: 1.25rem; }
li { margin-bottom: 0.3rem; }
a { color: var(--color-link); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--font-mono); font-size: 0.88em; overflow-wrap: anywhere; }
small { color: var(--color-muted); font-size: var(--text-sm); }
strong { font-weight: 650; }
:focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; border-radius: 2px; }

/* 3. Layout */
.top, main, .bottom { max-width: var(--width); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 2rem;
}
.brand { font-weight: 650; color: var(--color-text); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1rem; }
.nav a { color: var(--color-muted); text-decoration: none; }
.nav a:hover { color: var(--color-text); }
main { padding-top: 3rem; padding-bottom: 3rem; }
main > section:first-of-type > h2:first-child { margin-top: 0; }
.bottom { padding-top: 1.5rem; padding-bottom: 3rem; color: var(--color-muted); font-size: var(--text-sm); }
.bottom a { color: inherit; }

/* 4. Forms and buttons */
form.inline { display: inline; }
.field { display: block; margin-bottom: 1rem; }
.field span { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.field small { display: block; margin-top: 0.25rem; }
.check { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 1rem; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--color-rule);
  border-radius: 4px;
}
input[type="text"]:hover, input[type="email"]:hover, input[type="password"]:hover { border-color: var(--color-muted); }
button, .button {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  font: inherit;
  line-height: 1.4;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-muted);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { color: var(--color-text); border-color: var(--color-text); }
button.primary, .button.primary { color: var(--color-bg); background: var(--color-text); border-color: var(--color-text); }
button.primary:hover, .button.primary:hover { color: var(--color-bg); background: var(--color-muted); border-color: var(--color-muted); }
button.danger, .button.danger, button.danger:hover, .button.danger:hover { color: var(--color-bad); border-color: var(--color-bad); }
button.link, button.link:hover {
  padding: 0;
  line-height: inherit;
  color: var(--color-link);
  background: none;
  border: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
.nav button.link, .nav button.link:hover { color: var(--color-muted); text-decoration: none; }
.nav button.link:hover { color: var(--color-text); }
form > button { margin-bottom: 1rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1rem 0; }
.actions form, .actions form > button { margin: 0; }

/* 5. Components */
.notice { padding-left: 1rem; border-left: 2px solid var(--color-link); }
.error { padding-left: 1rem; border-left: 2px solid var(--color-bad); color: var(--color-bad); }
.note { color: var(--color-muted); font-size: var(--text-sm); }
.check { min-height: 1.5em; margin-top: -0.5rem; font-size: var(--text-sm); color: var(--color-muted); }
.check-ok { color: var(--color-link); }
.check-bad { color: var(--color-bad); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; }
dt { color: var(--color-muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.instance h2 { overflow-wrap: anywhere; }
.state { margin-left: 0.4rem; font-size: var(--text-sm); font-weight: 400; color: var(--color-muted); }
.state-pending, .state-past_due { color: var(--color-warn); }
.state-suspended, .state-deleted { color: var(--color-bad); }
.secret { font-family: var(--font-mono); font-size: 1.05rem; letter-spacing: 0.05em; user-select: all; }
button.copy { margin-left: 0.5rem; padding: 0.1rem 0.5rem; font-size: var(--text-sm); vertical-align: baseline; }
button.copy[hidden] { display: none; }
.wrap { overflow-wrap: anywhere; user-select: all; }
.codes { list-style: none; padding: 0; columns: 2; font-family: var(--font-mono); font-size: 1.05rem; }
.qr { display: block; width: 12rem; height: 12rem; margin-bottom: 1rem; background: #ffffff; }
