/* ===========================================================================
   PDF Toolkit — design system
   Clean, Sejda-style. Light-first, green accent, system fonts.
   =========================================================================== */
:root {
  --green: #2b9348;
  --green-dark: #1f7a39;
  --green-light: #e8f6ec;
  --ink: #1d2433;
  --ink-soft: #51607a;
  --muted: #8694ab;
  --line: #e4e9f1;
  --bg: #f6f8fb;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(20, 30, 60, .04), 0 8px 24px rgba(20, 30, 60, .06);
  --shadow-lg: 0 12px 40px rgba(20, 30, 60, .14);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1160px;
  --red: #e5484d;
  --amber: #f0a020;
  --blue: #3b82f6;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }
.muted { color: var(--muted); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .7em 1.3em; border-radius: 999px; border: 1px solid transparent;
  background: var(--green); color: #fff; transition: .15s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { background: var(--green-dark); text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.lg { padding: .95em 1.8em; font-size: 1.05rem; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); border-color: var(--muted); }
.btn.block { width: 100%; }

/* ---- Header ---- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.2rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--green), #36c46a);
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
}
.nav { display: flex; gap: 4px; margin-left: 6px; flex: 1; }
.nav a { color: var(--ink-soft); font-weight: 600; padding: 8px 12px; border-radius: 8px; font-size: .94rem; }
.nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.head-cta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-sel { font: inherit; font-size: .88rem; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-soft); cursor: pointer; max-width: 150px; }
.lang-sel:focus { outline: none; border-color: var(--green); }
html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .nav, html[dir="rtl"] .trust, html[dir="rtl"] .actions { flex-direction: row-reverse; }
.menu-btn { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

/* ---- Hero ---- */
.hero { padding: 60px 0 30px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
.hero p { font-size: 1.15rem; color: var(--ink-soft); max-width: 620px; margin: 0 auto 26px; }
.search-box { max-width: 560px; margin: 0 auto; position: relative; }
.search-box input {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 15px 18px 15px 48px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow);
}
.search-box input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px var(--green-light); }
.search-box .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.trust { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 22px; color: var(--ink-soft); font-size: .9rem; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }

/* ---- Tool grid ---- */
.cat { margin: 38px 0; scroll-margin-top: 80px; }
.cat h2 { font-size: 1.35rem; display: flex; align-items: center; gap: 10px; }
.cat h2 .pill { font-size: .7rem; font-weight: 700; color: var(--green-dark); background: var(--green-light); padding: 3px 9px; border-radius: 999px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.tool-card {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; transition: .15s ease; position: relative;
}
.tool-card:hover { text-decoration: none; border-color: #cfd8e6; box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card .ic {
  flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  font-size: 21px; background: var(--green-light);
}
.tool-card h3 { font-size: 1rem; margin: 0 0 3px; color: var(--ink); }
.tool-card p { margin: 0; font-size: .85rem; color: var(--muted); line-height: 1.4; }
.tool-card .tag { position: absolute; top: 10px; right: 10px; font-size: .62rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.tag.server { background: #fff4e5; color: #b4690e; }
.tag.beta { background: #eef2ff; color: #4f46e5; }
.tag.online { background: #e8f1ff; color: #2563eb; }
.tag.soon { background: #f3f0ff; color: #7c3aed; }
.tag.new { background: #e8f6ec; color: #1f7a39; }
.no-results { text-align: center; color: var(--muted); padding: 40px; display: none; }

/* ---- Tool page ---- */
.tool-hero { text-align: center; padding: 40px 0 18px; }
.tool-hero .ic { width: 60px; height: 60px; border-radius: 16px; background: var(--green-light); display: grid; place-items: center; font-size: 30px; margin: 0 auto 14px; }
.tool-hero h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.tool-hero p { color: var(--ink-soft); max-width: 560px; margin: 0 auto; font-size: 1.05rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--muted); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; margin: 22px auto 0; max-width: 820px; }

/* dropzone */
.drop {
  border: 2px dashed #c6d2e3; border-radius: var(--radius); background: #fbfcfe;
  padding: 48px 24px; text-align: center; cursor: pointer; transition: .15s ease;
}
.drop:hover, .drop.over { border-color: var(--green); background: var(--green-light); }
.drop .big { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.drop .ico { font-size: 42px; margin-bottom: 10px; }
.drop small { color: var(--muted); display: block; margin-top: 8px; }

/* file list */
.files { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.file-row .fic { width: 34px; height: 34px; border-radius: 8px; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.file-row .meta { flex: 1; min-width: 0; }
.file-row .meta b { display: block; font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .meta small { color: var(--muted); font-size: .8rem; }
.file-row .handle { cursor: grab; color: var(--muted); padding: 0 4px; }
.file-row .rm { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.file-row .rm:hover { background: #fde8e8; color: var(--red); }
.file-row.dragging { opacity: .5; }

/* options */
.opts { margin-top: 20px; display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field input[type=text], .field input[type=number], .field input[type=password], .field select {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.field .hint { font-size: .8rem; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-card { flex: 1; min-width: 130px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; transition: .12s; }
.radio-card:hover { border-color: var(--green); }
.radio-card input { margin-right: 6px; }
.radio-card.sel { border-color: var(--green); background: var(--green-light); }
.radio-card b { font-size: .9rem; }
.radio-card span { display: block; font-size: .78rem; color: var(--muted); }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: .92rem; }

.actions { margin-top: 22px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.status { font-size: .9rem; color: var(--ink-soft); }
.status.err { color: var(--red); }
.status.ok { color: var(--green-dark); }

/* progress */
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 14px; display: none; }
.bar.show { display: block; }
.bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }

/* result */
.result { display: none; text-align: center; padding: 14px 0; }
.result.show { display: block; }
.result .ok-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--green-light); color: var(--green-dark); display: grid; place-items: center; font-size: 34px; margin: 0 auto 12px; }

/* page thumbnails (organize/rotate/delete) */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 12px; margin-top: 18px; }
.pg { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; position: relative; cursor: grab; }
.pg canvas { width: 100%; display: block; }
.pg .n { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; text-align: center; padding: 2px; }
.pg .act { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.pg .act button { width: 24px; height: 24px; border: 0; border-radius: 6px; background: rgba(255,255,255,.92); cursor: pointer; font-size: 13px; display: grid; place-items: center; box-shadow: var(--shadow); }
.pg .act button:hover { background: #fff; }
.pg.sel { outline: 3px solid var(--green); }
.pg.del { opacity: .35; }

/* how-it-works / SEO content */
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin: 30px auto; max-width: 900px; }
.step { text-align: center; padding: 10px; }
.step .num { width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; display: grid; place-items: center; margin: 0 auto 10px; }
.faq { max-width: 760px; margin: 30px auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { color: var(--ink-soft); margin: 10px 0 0; }
.related { max-width: 900px; margin: 24px auto; }

/* ---- interactive editors (edit / fill-sign / forms) ---- */
.ed-toolbar { position: sticky; top: 64px; z-index: 20; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); margin-bottom: 16px; }
.ed-btn { font: inherit; font-size: .86rem; font-weight: 600; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ed-btn:hover { background: var(--bg); }
.ed-btn.on { background: var(--green); color: #fff; border-color: var(--green); }
.ed-btn.primary { background: var(--green); color: #fff; border-color: var(--green); margin-left: auto; }
.ed-btn.primary:hover { background: var(--green-dark); }
.ed-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.ed-toolbar input[type=color] { width: 32px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: #fff; cursor: pointer; }
.ed-toolbar input[type=number] { width: 62px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.ed-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; overflow-x: auto; }
.ed-page { position: relative; box-shadow: var(--shadow); background: #fff; flex: none; }
.ed-bg, .ed-annot { position: absolute; top: 0; left: 0; display: block; }
.ed-annot { z-index: 2; }
.ed-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 3; }
.ed-el { position: absolute; cursor: move; min-width: 20px; min-height: 16px; }
.ed-el.text { padding: 2px 4px; outline: 1px dashed transparent; white-space: pre; font-family: Helvetica, Arial, sans-serif; }
.ed-el.text:focus { outline: 1px dashed var(--green); }
.ed-el.sel { outline: 2px solid var(--green); }
.ed-el img { width: 100%; height: 100%; display: block; pointer-events: none; }
.ed-el .rm { position: absolute; top: -10px; right: -10px; width: 20px; height: 20px; border-radius: 50%; border: 0;
  background: var(--red); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; display: none; }
.ed-el:hover .rm, .ed-el.sel .rm { display: block; }
.ed-el .rz { position: absolute; bottom: -6px; right: -6px; width: 14px; height: 14px; background: var(--green); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; display: none; }
.ed-el:hover .rz, .ed-el.sel .rz { display: block; }
.ed-el.field { background: rgba(43,147,72,.12); border: 1.5px solid var(--green); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: .72rem; color: var(--green-dark); font-weight: 600; }
.ed-hint { text-align: center; color: var(--muted); font-size: .88rem; margin-bottom: 12px; }
/* signature modal */
.sig-back { position: fixed; inset: 0; background: rgba(15,20,30,.5); z-index: 100; display: grid; place-items: center; }
.sig-box { background: #fff; border-radius: var(--radius); padding: 22px; width: min(460px, 92vw); box-shadow: var(--shadow-lg); }
.sig-box h3 { margin: 0 0 12px; }
.sig-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.sig-pad { border: 2px dashed var(--line); border-radius: 10px; width: 100%; height: 170px; touch-action: none; cursor: crosshair; background: #fcfdff; }
.sig-type { width: 100%; font-size: 2rem; padding: 20px; border: 2px dashed var(--line); border-radius: 10px; text-align: center; font-family: "Segoe Script", "Brush Script MT", cursive; }
.sig-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }
/* workflows */
.wf-steps { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.wf-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.wf-step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .85rem; flex: none; }
.wf-step b { flex: 1; }
.wf-add { display: flex; gap: 8px; }
.wf-add select { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* ---- pricing ---- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; max-width: 920px; margin: 30px auto; align-items: start; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); position: relative; }
.plan.featured { border-color: var(--green); border-width: 2px; box-shadow: var(--shadow-lg); }
.plan .badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.plan .badge.soon { background: var(--amber); }
.plan h3 { font-size: 1.3rem; margin-bottom: 4px; }
.plan .price { font-size: 2.4rem; font-weight: 800; margin: 10px 0 2px; }
.plan .price small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.plan .sub { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 11px; }
.plan li { display: flex; gap: 9px; font-size: .93rem; align-items: flex-start; }
.plan li::before { content: "✓"; color: var(--green-dark); font-weight: 800; flex: none; }
.plan li.no { color: var(--muted); }
.plan li.no::before { content: "○"; color: var(--muted); }
.pricing-note { text-align: center; color: var(--muted); max-width: 620px; margin: 8px auto 0; font-size: .92rem; }

/* footer */
.site-foot { background: #11161f; color: #aab4c5; margin-top: 60px; padding: 46px 0 26px; }
.site-foot a { color: #cdd6e4; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 26px; }
.foot-grid h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; font-size: .9rem; }
.foot-bottom { border-top: 1px solid #232b38; margin-top: 32px; padding-top: 18px; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.privacy-note { background: var(--green-light); border: 1px solid #bfe6c9; color: var(--green-dark); border-radius: var(--radius-sm); padding: 12px 16px; font-size: .88rem; display: flex; gap: 8px; align-items: center; max-width: 820px; margin: 18px auto 0; }

@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; border-bottom: 1px solid var(--line); padding: 8px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .menu-btn { display: block; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
}
