/*
  Press app scaffold — shared shell + upload styles.

  Layout mirrors CoordXY: a top bar (brand, step pills, actions), a left
  sidebar that changes per step, and a main stage. Each app sets its own
  colors by overriding the tokens in :root from its own stylesheet.

  Vendored copy. The source of truth lives in the PDF-Inspect repo until the
  scaffold is promoted to its own home (see scaffold/README.md).
*/

:root {
  --bg: #05090d;
  --panel: #0c1117;
  --panel-2: #121921;
  --border: #1f2a35;
  --text: #eef2f6;
  --text-dim: #8e9aa6;
  --accent: #fc7a05;
  --accent-strong: #f85c04;
  --accent-contrast: #0b0f14;
  --accent-soft: rgba(252, 122, 5, 0.12);
  --good: #3fcf8e;
  --warn: #ffb020;
  --bad: #ff5a5f;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 8px;
  --sidebar-w: 310px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 32px);
}
button, input, select { font: inherit; }
a { color: var(--accent); }

.sc-app { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- top bar ---------- */
.sc-topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0d1218, #080c11);
  position: sticky; top: 0; z-index: 20;
}
.sc-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.sc-brand img { width: 40px; height: 40px; border-radius: 9px; box-shadow: 0 0 0 1px var(--accent-soft), 0 0 18px rgba(252,122,5,.25); }
.sc-wordmark { font-weight: 800; font-size: 21px; letter-spacing: .2px; line-height: 1; }
.sc-wordmark span { color: var(--accent); }
.sc-tagline { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--text-dim); text-transform: uppercase; margin-top: 5px; }

.sc-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-step {
  font-family: var(--mono); font-size: 11px; padding: 5px 10px; border-radius: 4px;
  border: 1px solid var(--border); color: var(--text-dim); background: var(--panel);
}
.sc-step.is-active { border-color: var(--accent); color: var(--accent); }
.sc-step.is-done { border-color: var(--good); color: var(--good); }

.sc-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- buttons ---------- */
.sc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 6px; border: 1px solid transparent; cursor: pointer;
  background: linear-gradient(180deg, #ff8a1f, var(--accent-strong)); color: #fff; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.sc-btn:hover { filter: brightness(1.08); }
.sc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sc-btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.sc-btn.secondary { background: var(--panel-2); border-color: var(--border); color: var(--text); font-weight: 500; }
.sc-btn.secondary:hover { border-color: var(--accent); }
.sc-btn.block { width: 100%; }
.sc-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- tools menu (the family of apps) ---------- */
.sc-menu { position: relative; }
.sc-menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; margin: 0; padding: 6px;
  list-style: none; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0,0,0,.55); z-index: 30;
}
.sc-menu-list li a {
  display: block; padding: 9px 10px; border-radius: 6px; color: var(--text); text-decoration: none;
}
.sc-menu-list li a:hover, .sc-menu-list li a:focus-visible { background: var(--accent-soft); outline: none; }
.sc-menu-list li a[aria-current="page"] { color: var(--accent); }
.sc-menu-list small { display: block; color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.sc-menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- body ---------- */
.sc-main { display: flex; flex: 1; min-height: 0; }
.sc-sidebar {
  width: var(--sidebar-w); flex-shrink: 0; border-right: 1px solid var(--border);
  background: var(--panel); padding: 20px 18px; overflow-y: auto;
}
.sc-sidebar h3 {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}
.sc-hint { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin: 0 0 16px; }
.sc-stage { flex: 1; min-width: 0; padding: 24px; }

/* ---------- upload dropzone ---------- */
.sc-dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 24px; text-align: center; border-radius: 12px;
  border: 2px dashed rgba(252,122,5,.55); background: rgba(12,17,23,.82);
  transition: border-color .15s ease, background .15s ease;
}
.sc-dropzone.is-dragging { border-color: var(--accent); background: rgba(252,122,5,.08); }
.sc-dropzone svg.sc-drop-icon { width: 56px; height: 56px; color: var(--accent); }
.sc-drop-title { font-size: 18px; font-weight: 600; }
.sc-drop-or { color: var(--text-dim); font-size: 13px; }
.sc-drop-note { color: var(--text-dim); font-size: 12px; max-width: 380px; line-height: 1.5; }
.sc-drop-error { color: var(--bad); font-size: 13px; min-height: 1em; }
.sc-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- narrow screens ---------- */
@media (max-width: 860px) {
  .sc-topbar { padding: 10px 16px; position: static; }
  .sc-steps { order: 3; width: 100%; }
  .sc-main { flex-direction: column; }
  .sc-sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sc-stage { padding: 16px; }
}

@media print {
  body { background: #fff; color: #000; background-image: none; }
  .sc-topbar, .sc-sidebar { display: none !important; }
  .sc-stage { padding: 0; }
}

/* Consent gate above the dropzone, and the persistent legal line. */
.sc-upload-group { display: grid; gap: 14px; }
.sc-consent {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.sc-consent p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }
.sc-consent-warn { color: var(--warn) !important; }
.sc-consent-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13.5px; line-height: 1.45; color: var(--text); }
.sc-consent-check input { margin: 2px 0 0; width: 17px; height: 17px; flex: none; cursor: pointer; accent-color: var(--accent); }
.sc-dropzone.is-locked { opacity: 0.55; }
.sc-dropzone.is-locked .sc-btn:disabled { cursor: not-allowed; }

.sc-legal {
  padding: 18px 24px 26px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.sc-legal-warn { margin-top: 2px; }
