/* SPDX-License-Identifier: AGPL-3.0-or-later
   Copyright (C) 2026 BTLTECH LTD */
/* BTLTech PDF Toolkit - shared styles for every page.
   Dark, single theme, no build step, no CSS framework. */

:root {
  --bg: #0b1220;
  --panel: #121c30;
  --panel-2: #0e1728;
  --line: #243350;
  --line-strong: #33456b;
  --ink: #e6edf7;
  --muted: #93a4c0;
  --muted-2: #7487a8;
  --accent: #5b8cff;
  --accent-2: #2f6feb;
  --danger: #ff7b72;
  --ok: #3fb950;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 16px 48px;
}

/* ------------------------------------------------------------------ nav --- */

nav.top {
  width: 100%;
  max-width: 1120px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
nav.top .logo {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-right: 18px;
}
nav.top a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 12px;
  border-radius: 9px;
  white-space: nowrap;
}
nav.top a:hover { color: var(--ink); background: #17233c; }
nav.top a.active { color: var(--ink); background: #1b2947; }

/* --------------------------------------------------------------- header --- */

header.page { text-align: center; margin-bottom: 26px; max-width: 720px; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; }
.sub { color: var(--muted); margin-top: 10px; font-size: 15px; line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------------------------------------------------------------- cards --- */

.card {
  width: 100%;
  max-width: 700px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 4px; }
.card .card-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; line-height: 1.5; }

.grid {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

a.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .15s, transform .15s;
}
a.card-link:hover { border-color: var(--accent); transform: translateY(-2px); }
a.card-link .icon { font-size: 22px; }
a.card-link h2 { margin: 12px 0 8px; }
a.card-link p { color: var(--muted); font-size: 13px; line-height: 1.55; }
a.card-link .pill {
  display: inline-block;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}

/* ------------------------------------------------------------- dropzone --- */

.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  padding: 38px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  color: var(--muted);
  font-size: 15px;
}
.dropzone.drag { border-color: var(--accent); background: rgba(91, 140, 255, .08); }
.dropzone strong { color: var(--ink); }
.dropzone .browse { color: var(--accent); text-decoration: underline; }
input[type=file] { display: none; }

/* ------------------------------------------------------- fields/buttons --- */

.row { margin-top: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row label { color: var(--muted); font-size: 13px; }

input[type=text], input[type=number], input[type=password], select {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
input[type=text] { width: 190px; }
input[type=number] { width: 92px; }

label.check { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; cursor: pointer; }
label.check input { accent-color: var(--accent-2); }

button {
  background: var(--accent-2);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
}
button:hover:not(:disabled) { background: #3d7bfd; }
button:disabled { opacity: .45; cursor: default; }
button.ghost { background: #1b2947; }
button.ghost:hover:not(:disabled) { background: #24365c; }
button.small { padding: 6px 11px; font-size: 12px; }
.button-row { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------ file list --- */

ul.queue { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
li.item {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.meta { flex: 1; min-width: 0; }
.name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.size { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.status { font-size: 12px; color: var(--muted); text-align: right; }
.status.error { color: var(--danger); max-width: 230px; }
.status.ok { color: var(--ok); }

.bar { height: 4px; background: #1c2942; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- notes --- */

footer.foot {
  margin-top: 26px;
  color: #5a6b8c;
  font-size: 12px;
  text-align: center;
  max-width: 700px;
  line-height: 1.6;
}
.notice { margin-top: 16px; font-size: 13px; border-radius: 10px; padding: 11px 14px; line-height: 1.5; }
.notice.ok { background: rgba(63, 185, 80, .12); color: #9be7a4; }
.notice.err { background: rgba(255, 123, 114, .12); color: #ffb3ae; }
.notice.info { background: rgba(91, 140, 255, .12); color: #b6ccff; }

.hidden { display: none !important; }

/* tools page: cards sit in a grid, so drop the stacked-card spacing */
.grid > .card { margin-top: 0; max-width: none; }
.picked { margin-top: 9px; min-height: 16px; }
.tool .card-sub { min-height: 34px; }
/* ------------------------------------------------------- source offer --- */
/* AGPL-3.0 s.13: the source link must be prominent on every page, so it gets
   its own line in the footer with a readable colour rather than the footnote grey. */
footer.foot .source-line { display: block; margin-top: 8px; color: var(--muted); }
footer.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
footer.foot a:hover { color: var(--ink); }
.prose p + p { margin-top: 14px; }
.prose p { line-height: 1.6; }
.prose a { color: var(--accent); }
a.btn {
  display: inline-block; background: var(--accent-2); color: #fff; text-decoration: none;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 14px;
}
a.btn:hover { background: #3d7bfd; }

/* Optional "support this tool" link (PDF_SUPPORT_URL). Absent by default, and
   nothing is ever gated behind it. */
.support-line a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.support-line a:hover { color: var(--ink); }
