/* 110-books client dashboard. Dark, quiet, one thing on the page.
   Behind it: ledger ruling drifting slowly, a warm margin line like accounting paper, a soft glow.
   Pure CSS: the page's CSP allows no scripts and no images. */
:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --ink: #ecebe6;
  --mute: #8b8d92;
  --panel: #0e0f12;
  --field: #16171b;
  --edge: rgba(255, 255, 255, .13);
  --edge-focus: rgba(255, 255, 255, .55);
  --accent: #ecebe6;
  --error: #ff9d8c;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  display: grid; place-items: center; overflow: hidden; position: relative;
  -webkit-font-smoothing: antialiased;
}
/* the background: a 30 s seamless video loop of the floating paths (see server.py). The inline
   SVG of the same curves is the still fallback for reduced motion. */
.bgv { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; z-index: 0; }
.bg  { position: fixed; inset: 0; width: 100%; height: 100%; color: #fff; pointer-events: none; z-index: 0; display: none; }
/* a still, soft tint behind the lines: plain gradients, no filter, no motion */
body { background:
  radial-gradient(ellipse 60% 50% at 30% 35%, rgba(120, 150, 255, .10), transparent 70%),
  radial-gradient(ellipse 60% 50% at 72% 70%, rgba(255, 170, 120, .06), transparent 70%),
  var(--bg); }

main { position: relative; z-index: 1; width: min(100% - 2rem, 20.5rem); }
.panel {
  background: var(--panel); border: 1px solid var(--edge); border-radius: 6px;
  padding: 1.5rem 1.5rem 1.375rem;
}
form.panel { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login h1 { text-align: center; font-size: 1.0625rem; font-weight: 600; letter-spacing: .01em; margin: .125rem 0 1.125rem; }
input {
  display: block; width: 100%; height: 2.5rem; padding: 0 .75rem; margin: 0;
  font: inherit; font-size: .9375rem; color: var(--ink);
  background: var(--field); border: 1px solid var(--edge); border-radius: 4px;
  transition: border-color .15s ease;
}
input::placeholder { color: var(--mute); }
input:focus { outline: none; border-color: var(--edge-focus); }
/* the browser's autofill tint (an olive box in Firefox's dark theme) must not paint over the field */
input:autofill, input:-webkit-autofill {
  box-shadow: 0 0 0 100px var(--field) inset; -webkit-text-fill-color: var(--ink); filter: none;
  background-color: var(--field); color: var(--ink);
}
button {
  display: block; width: 100%; height: 2.5rem; margin: 1rem 0 0;
  font: inherit; font-size: .9375rem; font-weight: 500;
  border: 0; border-radius: 4px; background: var(--accent); color: var(--bg); cursor: pointer;
  transition: opacity .15s ease;
}
button:hover { opacity: .88; }
button:focus-visible { outline: 2px solid var(--edge-focus); outline-offset: 2px; }
.error { color: var(--error); font-size: .8125rem; margin: .5rem 0 0; }

/* the page behind the login */
h1 { font-size: 1rem; font-weight: 600; margin: 0 0 .375rem; }
.muted { color: var(--mute); font-size: .9375rem; margin: 0; }
.logout { margin-top: 1.5rem; }
.logout button {
  width: auto; height: 2.125rem; padding: 0 .875rem; margin: 0;
  background: transparent; color: var(--mute); border: 1px solid var(--edge); font-size: .875rem;
}
.logout button:hover { color: var(--ink); border-color: var(--edge-focus); opacity: 1; }

/* phones: no scene at all — a white page and a clean login (Morris, 2026-09-10). The dark scene
   with the curves is for desktop. */
@media (max-width: 720px) {
  :root {
    color-scheme: light;
    --bg: #ffffff; --ink: #141414; --mute: #6f7176;
    --panel: #ffffff; --field: #ffffff; --edge: #d9d9d5; --edge-focus: #141414;
    --accent: #141414; --error: #b3261e;
  }
  .bg, .bgv { display: none; }
  body { background: var(--bg); }
  button { color: #fff; }
  .logout button { color: var(--mute); }
  .logout button:hover { color: var(--ink); }
}
/* reduced motion: the curves stay, still and half-lit; nothing moves */
@media (prefers-reduced-motion: reduce) and (min-width: 721px) {
  .bgv { display: none; }
  .bg { display: block; }
}

/* Arriving from 110.dk (and going back): the site and this login are the same origin, so the
   two documents hand over with a cross-document view transition and dissolve instead of cutting.
   CSS only, which this page's CSP requires. The matching opt-in is in 110.dk's site.css — both
   documents must declare it or nothing happens. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
