/* ============================================================
   PDF Tools — shared stylesheet
   Clean modern design · indigo/violet accent · light + dark mode
   ============================================================ */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-soft: #eef2ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #059669;
  --success-soft: #ecfdf5;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --header-h: 66px;
}
[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #141d33;
  --surface-2: #1b2540;
  --text: #eef2ff;
  --muted: #94a3b8;
  --border: #273350;
  --accent-soft: #1e2450;
  --danger-soft: #3a1d22;
  --success-soft: #123527;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 40px; padding-bottom: 70px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.brand-mark svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  color: var(--muted); font-weight: 500; font-size: 0.95rem;
  padding: 8px 12px; border-radius: 8px;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav-links {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px 20px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links .icon-btn { align-self: flex-start; margin-top: 6px; }
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 64px 0 48px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.02em; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--muted); font-size: 1.12rem; max-width: 640px; margin: 0 auto 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: 12px 22px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; transition: transform .06s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(99, 102, 241, 0.45); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-large { font-size: 1.08rem; padding: 15px 34px; }
.btn-small { font-size: 0.85rem; padding: 7px 13px; border-radius: 9px; }

/* ---------- Tool cards grid ---------- */
.section-title { text-align: center; font-size: 1.7rem; margin: 56px 0 8px; letter-spacing: -0.01em; }
.section-sub { text-align: center; color: var(--muted); margin: 0 0 30px; }
.tools-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px;
}
@media (max-width: 900px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tools-grid { grid-template-columns: 1fr; } }
.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; color: var(--text); box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .15s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.tool-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.tool-icon {
  width: 48px; height: 48px; border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.tool-icon svg { width: 24px; height: 24px; }
.tool-card h3 { margin: 0; font-size: 1.12rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.93rem; flex: 1; }
.tool-card .go { color: var(--accent); font-weight: 600; font-size: 0.92rem; }

/* ---------- Steps / features ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center;
}
.step-num {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.15rem;
}
.step h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 26px; }
@media (max-width: 640px) { .features { grid-template-columns: 1fr; } }
.feature {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.feature .fi {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.feature .fi svg { width: 20px; height: 20px; }
.feature h3 { margin: 0 0 4px; font-size: 1rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 26px auto 0; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 10px;
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq summary::marker { color: var(--accent); }
.faq details p { color: var(--muted); margin: 10px 0 2px; font-size: 0.95rem; }

/* ---------- Tool page ---------- */
.tool-page h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); letter-spacing: -0.02em; margin: 0 0 10px; }
.tool-page .lede { margin: 0 0 22px; max-width: 720px; }
.privacy-badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--success-soft); color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  font-weight: 600; font-size: 0.9rem;
  padding: 9px 16px; border-radius: 999px; margin-bottom: 22px;
}
.privacy-badge svg { width: 16px; height: 16px; }

.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 44px 24px; text-align: center;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent); background: var(--accent-soft);
}
.dropzone .dz-icon {
  width: 54px; height: 54px; border-radius: 15px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.dropzone .dz-icon svg { width: 26px; height: 26px; }
.dropzone strong { display: block; font-size: 1.05rem; }
.dropzone span { color: var(--muted); font-size: 0.9rem; }

.file-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
.file-item .fname { font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.file-item .fsize { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.file-item .fthumb {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 8px; object-fit: cover;
  background: var(--surface-2);
}
.file-actions { display: flex; gap: 6px; }
.mini-btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 8px; padding: 5px 10px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }
.mini-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

.options {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin: 20px 0;
  display: flex; flex-direction: column; gap: 16px;
}
.option-row { display: flex; flex-direction: column; gap: 7px; }
.option-row.inline { flex-direction: row; align-items: center; gap: 10px; }
.option-row label { font-weight: 600; font-size: 0.95rem; }
.option-row .hint { color: var(--muted); font-size: 0.85rem; }
.option-row input[type="text"],
.option-row input[type="number"],
.option-row select {
  font: inherit; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  max-width: 420px;
}
.option-row input:focus, .option-row select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.option-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

.action-row { margin: 8px 0 18px; }

.progress {
  height: 10px; background: var(--surface-2); border-radius: 999px;
  overflow: hidden; margin: 16px 0;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px; transition: width .2s ease;
}

.alert-error {
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: 12px; padding: 13px 17px; margin: 14px 0; font-size: 0.95rem; font-weight: 500;
}

.result-box {
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  border-radius: var(--radius); padding: 22px; margin: 16px 0;
}
.result-box h3 { margin: 0 0 8px; color: var(--success); font-size: 1.1rem; }
.result-box p { margin: 6px 0; font-size: 0.95rem; }
.result-box .dl-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.result-box .dl-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-box .dl-item .fname { font-weight: 600; font-size: 0.92rem; }

/* ---------- Content pages ---------- */
.prose { max-width: 780px; }
.prose h1 { letter-spacing: -0.02em; }
.prose h2 { margin-top: 34px; font-size: 1.35rem; }
.prose p, .prose li { color: var(--text); }
.prose .muted, .prose li.muted { color: var(--muted); }

/* ---------- Forms ---------- */
.form { max-width: 560px; display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.form label { font-weight: 600; font-size: 0.95rem; display: flex; flex-direction: column; gap: 7px; }
.form input, .form textarea {
  font: inherit; padding: 12px 15px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.form .field-error { color: var(--danger); font-size: 0.85rem; font-weight: 500; }
.form-note { color: var(--muted); font-size: 0.88rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; }
.footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 44px 20px 26px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px;
}
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }
.site-footer h4 { margin: 0 0 12px; font-size: 0.95rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer ul a { color: var(--muted); font-size: 0.92rem; }
.site-footer ul a:hover { color: var(--accent); }
.footer-brand p { color: var(--muted); font-size: 0.9rem; margin: 10px 0 0; }
.footer-bottom {
  max-width: 1120px; margin: 0 auto; padding: 18px 20px 26px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { margin: 0 0 18px; font-size: 0.88rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumbs li { display: flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before { content: "›"; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

/* ---------- Guide content ---------- */
.guide { max-width: 780px; margin: 46px 0 0; }
.guide h2 { font-size: 1.3rem; margin: 28px 0 10px; letter-spacing: -0.01em; }
.guide h2:first-child { margin-top: 0; }
.guide p { font-size: 0.97rem; margin: 0 0 12px; }
.guide ul, .guide ol { padding-left: 22px; margin: 0 0 12px; font-size: 0.97rem; }
.guide li { margin-bottom: 6px; }

/* ---------- Related tools ---------- */
.related-tools {
  margin-top: 46px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
}
.related-tools h2 { margin: 0 0 14px; font-size: 1.2rem; }
.related-tools ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 600px) { .related-tools ul { grid-template-columns: 1fr; } }
.related-tools a { font-weight: 600; font-size: 0.95rem; }
.related-tools p { margin: 3px 0 0; color: var(--muted); font-size: 0.86rem; }
