/* One stylesheet, no framework, no build step.
   Sized for a phone first; the desktop rules are the two media queries at the
   bottom. */

:root {
  color-scheme: light dark;

  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6862;
  --line: #e4e0d9;
  --accent: #3f6b5c;
  --accent-text: #ffffff;
  --danger: #a03b2c;
  --danger-bg: #fbecea;

  --radius: 10px;
  --pad: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --surface: #1e2024;
    --text: #e8e6e1;
    --muted: #9a968e;
    --line: #32353b;
    --accent: #7fb3a0;
    --accent-text: #10201b;
    --danger: #e8927f;
    --danger-bg: #33211d;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  /* Respect the notch and the Android gesture bar when installed. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1 { font-size: 1.4rem; margin: 0 0 .25rem; letter-spacing: -.01em; }

.muted { color: var(--muted); font-size: .875rem; margin: 0; }

/* ---- login ---- */

.centred {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--pad);
}

.card {
  width: 100%;
  max-width: 22rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

form { display: grid; gap: .875rem; margin-top: 1.25rem; }

label { display: grid; gap: .375rem; font-size: .875rem; color: var(--muted); }

input[type="text"], input[type="password"] {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  /* 16px minimum, or iOS Safari zooms the page on focus. */
  font-size: 16px;
  padding: .625rem .75rem;
  width: 100%;
}

input:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  /* 44px tall: the smallest reliable touch target on a phone. */
  min-height: 44px;
  padding: 0 1rem;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }

button.quiet {
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
}

.error {
  margin: 1rem 0 0;
  padding: .625rem .75rem;
  font-size: .875rem;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid currentColor;
  border-radius: 8px;
}

/* ---- app shell ---- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem var(--pad);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.bar h1 { font-size: 1.1rem; margin: 0; }

main { padding: var(--pad); max-width: 44rem; margin: 0 auto; }

.placeholder {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--muted);
}

@media (min-width: 40rem) {
  :root { --pad: 1.5rem; }
  h1 { font-size: 1.6rem; }
}
