/* Screen styles for the application pages (login, start, upload, error, extraction report).
   The OBC document itself has its own sheet: obc.css + print.css. All CSS is external (CSP, no inline). */

:root {
  --ink: #1a2733;
  --ink-soft: #3d4a57;
  --muted: #65717d;
  --rule: #d4dbe1;
  --hair: #e5eaee;
  --paper: #ffffff;
  --shore: #eef2f5;
  --water: #1e5a78;
  --water-deep: #16465e;
  --water-tint: #dfe8ef;
  --straw-tint: #f5efd8;
  --flag: #a52a2a;
  --flag-tint: #fbe9e6;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--shore);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--water);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--water-deep);
}

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

code {
  font-family: ui-monospace, Consolas, "SFMono-Regular", monospace;
  font-size: 0.9em;
  background: var(--hair);
  padding: 0.05em 0.35em;
  border-radius: 3px;
}

/* ---- masthead ------------------------------------------------------------------------------ */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.4rem 1.5rem 0;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark span {
  font-weight: 400;
  color: var(--ink-soft);
}

.masthead-link {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---- page column ---------------------------------------------------------------------------- */

.page {
  max-width: 60rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

h1 {
  font-family: var(--serif);
  font-size: 2.125rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 1rem;
}

h2 {
  font-family: var(--serif);
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 2.25rem 0 0.6rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.4rem;
}

p {
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.1875rem;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.muted {
  color: var(--muted);
}

/* The "nothing is stored" promise. A quiet panel, not an alert. */
/* Sits well below the main controls, but at reading size: people should read it. */
.callout {
  margin: 4.5rem 0 0;
  padding: 1rem 1.2rem;
  background: var(--water-tint);
  color: var(--ink-soft);
  border-radius: 3px;
  font-size: 1rem;
}

.error {
  margin: 0 0 1rem;
  color: var(--flag);
  font-weight: 600;
}

/* ---- forms and buttons ------------------------------------------------------------------------ */

form.login,
form.upload {
  display: grid;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

form.login {
  max-width: 22rem;
}

form.upload {
  max-width: 36rem;
}

label {
  font-weight: 600;
}

input[type="password"],
input[type="file"] {
  font: inherit;
  width: 100%;
  padding: 0.55rem 0.7rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

input[type="password"]:focus,
input[type="file"]:focus {
  border-color: var(--water);
  outline: 2px solid var(--water);
  outline-offset: 0;
}

/* The file picker is the main control on the upload page: a large dashed drop area on the page
   background, with the browser's own "Choose file" button drawn as a primary button inside it. */
input[type="file"] {
  padding: 1.1rem 1.1rem;
  font-size: 1.125rem;
  background: transparent;
  border: 2px dashed var(--rule);
  border-radius: 4px;
  cursor: pointer;
}

input[type="file"]:hover {
  border-color: var(--water);
}

input[type="file"]:focus {
  border-style: solid;
}

input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  margin-right: 1rem;
  padding: 0.7rem 1.4rem;
  color: var(--paper);
  background: var(--water);
  border: 1px solid var(--water);
  border-radius: 3px;
  cursor: pointer;
}

input[type="file"]:hover::file-selector-button {
  background: var(--water-deep);
  border-color: var(--water-deep);
}

button,
a.button {
  font: inherit;
  font-weight: 600;
  display: inline-block;
  padding: 0.6rem 1.15rem;
  color: var(--paper);
  background: var(--water);
  border: 1px solid var(--water);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  justify-self: start;
  line-height: 1.3;
}

button:hover,
a.button:hover {
  background: var(--water-deep);
  border-color: var(--water-deep);
  color: var(--paper);
}

a.button.secondary,
button.secondary {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--rule);
}

a.button.secondary:hover,
button.secondary:hover {
  background: var(--hair);
  border-color: var(--rule);
  color: var(--ink);
}

form.login button {
  margin-top: 0.4rem;
}

form.upload {
  gap: 1rem;
}

form.upload button {
  margin-top: 1rem;
  font-size: 1.125rem;
  padding: 0.8rem 1.7rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.actions form {
  margin: 0;
}

/* ---- start page ------------------------------------------------------------------------------- */

ul.features {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

ul.features li {
  border-bottom: 1px solid var(--rule);
}

ul.features a {
  display: block;
  padding: 1.1rem 0.25rem;
  text-decoration: none;
  color: inherit;
}

ul.features a:hover .feature-title {
  color: var(--water-deep);
  text-decoration-thickness: 2px;
}

.feature-title {
  font-family: var(--serif);
  font-size: 1.3125rem;
  font-weight: 600;
  margin: 0 0 0.15rem;
  color: var(--water);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.feature-desc {
  margin: 0;
  color: var(--ink-soft);
}

/* ---- extraction report ------------------------------------------------------------------------- */

dl.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 1.5rem;
  row-gap: 0.3rem;
  margin: 0.75rem 0 0;
}

dl.facts dt {
  color: var(--muted);
}

dl.facts dd {
  margin: 0;
}

ul.compact {
  columns: 2;
  column-gap: 2rem;
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
}

ul.compact li,
ul.plain li {
  break-inside: avoid;
  padding: 0.1rem 0;
}

ul.plain {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
}

.count {
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.85em;
  margin-left: 0.4rem;
}

@media (max-width: 36rem) {
  h1 {
    font-size: 1.75rem;
  }

  ul.compact {
    columns: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a,
  button,
  input {
    transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
  }
}
