/* ===== PDFforge — shared styles ===== */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #14161c;
  --muted: #5b6472;
  --line: #e3e7ee;
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #eef0ff;
  --ok: #0f9d58;
  --danger: #d93025;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,22,28,.04), 0 8px 24px rgba(20,22,28,.06);
  --maxw: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1016;
    --surface: #171a22;
    --ink: #eef1f6;
    --muted: #9aa4b2;
    --line: #262b36;
    --brand: #7c74ff;
    --brand-soft: #1c1f33;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #a78bfa);
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
}
.nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); font-size: 14px; font-weight: 500;
  padding: 7px 11px; border-radius: 9px;
}
.nav a:hover { color: var(--ink); background: var(--brand-soft); text-decoration: none; }

/* Hero */
.hero { text-align: center; padding: 54px 0 28px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -.02em; }
.hero p { font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); max-width: 640px; margin: 0 auto; }
.badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}

/* Tool grid */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding: 26px 0 40px; }
.tool-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.tool-card .ico { font-size: 26px; }
.tool-card h3 { margin: 12px 0 5px; font-size: 17px; color: var(--ink); }
.tool-card p { margin: 0; font-size: 14px; color: var(--muted); }

/* Tool page layout */
.tool-main { padding: 30px 0 60px; }
.tool-head { text-align: center; margin-bottom: 26px; }
.tool-head .ico { font-size: 40px; }
.tool-head h1 { font-size: clamp(24px, 4vw, 34px); margin: 10px 0 8px; letter-spacing: -.02em; }
.tool-head p { color: var(--muted); max-width: 560px; margin: 0 auto; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; margin: 0 auto; max-width: 720px;
}
.drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 40px 20px; text-align: center;
  cursor: pointer; transition: border-color .12s, background .12s; color: var(--muted);
}
.drop:hover, .drop.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.drop strong { color: var(--ink); }
.drop input { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 600; font-size: 15px;
  padding: 12px 20px; border-radius: 11px; background: var(--brand); color: var(--brand-ink);
  transition: filter .12s, opacity .12s;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--brand-soft); color: var(--brand); }
.btn.block { width: 100%; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }

.filelist { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.filelist li {
  display: flex; align-items: center; gap: 12px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px;
}
.filelist .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .fsize { color: var(--muted); font-size: 13px; }
.filelist button { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; }
.filelist button:hover { color: var(--danger); }
.reorder { cursor: grab; color: var(--muted); user-select: none; }

.field { margin-top: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field input[type=text], .field input[type=number], .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-size: 15px;
}
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; }
.range-row output { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.status { margin-top: 18px; text-align: center; font-size: 14px; min-height: 20px; }
.status.err { color: var(--danger); }
.status.ok { color: var(--ok); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 20px; }
.thumbs figure { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.thumbs img { width: 100%; border-radius: 6px; display: block; }
.thumbs figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Ad slots */
.ad-slot {
  margin: 26px auto; max-width: 720px; min-height: 90px; border: 1px dashed var(--line);
  border-radius: 12px; display: grid; place-items: center; color: var(--muted);
  font-size: 12px; background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.ad-slot[data-filled="true"] { border: 0; min-height: 0; background: none; }

/* Content / SEO copy */
.content { max-width: 720px; margin: 40px auto 0; }
.content h2 { font-size: 22px; margin: 30px 0 10px; letter-spacing: -.01em; }
.content h3 { font-size: 17px; margin: 22px 0 6px; }
.content p, .content li { color: var(--muted); }
.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; margin-bottom: 10px; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 12px 0; }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 50px; padding: 30px 0; color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.site-foot a { color: var(--muted); }
.site-foot .spacer { margin-left: auto; }

.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: 22px 0 0; color: var(--muted); font-size: 14px; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
