/* userpdf.com — site styles */
:root {
  --paper: #f3f5f2;
  --sheet: #ffffff;
  --ink: #18202b;
  --ink-soft: #4a5563;
  --rule: #d5dad3;
  --cobalt: #2446c7;
  --cobalt-ink: #ffffff;
  --mark: #ffe14d;
  --stamp: #b8322a;
  --ok: #1d7a4a;
  --shadow: 0 1px 0 rgba(24, 32, 43, .06), 0 10px 30px -12px rgba(24, 32, 43, .25);
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121820;
    --sheet: #1b232e;
    --ink: #e9ece7;
    --ink-soft: #a8b1bc;
    --rule: #2e3946;
    --cobalt: #7d97ff;
    --cobalt-ink: #0e1420;
    --mark: #8a7414;
    --stamp: #ff8a7f;
    --ok: #6fd3a0;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
}
img, canvas { max-width: 100%; }
a { color: var(--cobalt); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font: 800 1.25rem/1 var(--display); font-stretch: 112%; letter-spacing: -.01em; }
.logo svg { flex: none; }
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Hero */
.hero { padding: 3.25rem 0 1.75rem; }
.hero h1 {
  margin: 0 0 .6rem;
  font: 800 clamp(2.2rem, 5.5vw, 4rem)/1.02 var(--display);
  font-stretch: 118%;
  letter-spacing: -.02em;
  max-width: 18ch;
}
.hero p { margin: 0; max-width: 58ch; color: var(--ink-soft); font-size: 1.15rem; }
.hero p.local-note { margin-top: 1rem; font-size: 1rem; color: var(--ink); }
.local-note mark { color: inherit; background: linear-gradient(transparent 58%, var(--mark) 58%); padding: 0 .12rem; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Home tool index */
.tool-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0; border-top: 1px solid var(--rule); margin: 1rem 0 3rem; }
.tool-index a {
  display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto 1fr; gap: .2rem .9rem; align-items: start;
  padding: 1.15rem .75rem 1.25rem 0; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.tool-index a:hover .t-name { text-decoration: underline; }
.tool-index .t-icon { grid-row: span 2; width: 44px; height: 54px; }
.tool-index .t-name { font: 700 1.15rem/1.2 var(--display); font-stretch: 108%; }
.tool-index .t-desc { color: var(--ink-soft); font-size: .95rem; line-height: 1.45; }

/* The sheet: drop zone */
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; padding-bottom: 2.5rem; }
@media (max-width: 860px) { .workbench { grid-template-columns: 1fr; } }
.sheet {
  position: relative;
  background: var(--sheet);
  border-radius: 3px;
  box-shadow: var(--shadow);
  min-height: 340px;
  padding: 3rem 2rem 2rem;
  clip-path: polygon(0 0, calc(100% - 42px) 0, 100% 42px, 100% 100%, 0 100%);
}
.sheet::after {
  content: ""; position: absolute; top: 0; right: 0; width: 42px; height: 42px;
  background: linear-gradient(225deg, var(--paper) 50%, var(--rule) 50%);
}
.drop {
  display: grid; place-items: center; text-align: center; gap: .75rem;
  min-height: 276px; border: 2px dashed var(--rule); border-radius: 6px; padding: 1.5rem;
  transition: border-color .15s, background-color .15s;
}
.drop.is-over { border-color: var(--cobalt); background: color-mix(in srgb, var(--cobalt) 7%, transparent); }
.drop h2 { margin: 0; font: 700 1.5rem/1.2 var(--display); font-stretch: 110%; }
.drop p { margin: 0; color: var(--ink-soft); }
.drop.has-files { min-height: 0; border-style: solid; border-color: transparent; padding: 0; place-items: stretch; text-align: left; }
.drop.has-files .drop-empty { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 700 1rem/1 var(--body); padding: .9rem 1.4rem; border-radius: 999px;
  border: 2px solid var(--cobalt); background: var(--cobalt); color: var(--cobalt-ink);
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn.secondary { background: transparent; color: var(--cobalt); }
.btn.small { padding: .55rem .9rem; font-size: .9rem; }
.btn.wide { width: 100%; }

/* File list */
.file-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.file-item {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: .85rem; align-items: center;
  padding: .55rem .6rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet);
}
.file-item.dragging { opacity: .4; }
.file-item.drag-target { border-color: var(--cobalt); }
.file-item .thumb { width: 46px; height: 58px; background: var(--paper); border: 1px solid var(--rule); display: grid; place-items: center; overflow: hidden; }
.file-item .thumb canvas, .file-item .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.file-item .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .meta { color: var(--ink-soft); font-size: .88rem; }
.file-item .actions { display: flex; gap: .25rem; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer; font-size: 1rem; line-height: 1;
}
.icon-btn:hover { border-color: var(--ink-soft); }
.add-more { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

/* Page grid (organize) */
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.page-card { position: relative; display: grid; gap: .35rem; justify-items: center; padding: .5rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); cursor: grab; }
.page-card.dragging { opacity: .4; }
.page-card.drag-target { border-color: var(--cobalt); }
.page-card .pthumb { width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; background: var(--paper); overflow: hidden; }
.page-card canvas { max-height: 100%; transition: transform .2s; box-shadow: 0 0 0 1px var(--rule); }
.page-card .pnum { font-size: .85rem; color: var(--ink-soft); }
.page-card .pactions { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem; }
.page-card .icon-btn { width: 29px; height: 29px; font-size: .85rem; }
.page-card { min-width: 0; }

/* Options panel */
.panel { position: sticky; top: 1rem; display: grid; gap: 1.1rem; max-height: calc(100vh - 2rem); overflow-y: auto; padding: 2px; }
@media (max-width: 860px) {
  .panel { position: static; max-height: none; overflow: visible; }
  .has-viewer.has-files .panel { order: -1; }
}
.options { display: grid; gap: 1rem; }
.options p { margin: 0; color: var(--ink-soft); }
.options h2 { margin: 0; font: 700 1.1rem/1.2 var(--display); font-stretch: 108%; }
.field { display: grid; gap: .35rem; }
.field > span, .field legend { font-weight: 700; font-size: .95rem; }
.field small { color: var(--ink-soft); font-size: .85rem; line-height: 1.4; }
.choice small { display: block; margin-top: .15rem; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.choice { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; padding: .2rem 0; cursor: pointer; }
.choice input { margin-top: .3rem; accent-color: var(--cobalt); }
input[type="text"], input[type="password"], input[type="number"], select {
  font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule);
  border-radius: 6px; padding: .55rem .7rem; width: 100%;
}
input[type="range"] { width: 100%; accent-color: var(--cobalt); }
input[type="color"] { width: 48px; height: 36px; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); padding: 2px; }

.status { margin: 0; min-height: 1.5em; font-size: .95rem; color: var(--ink-soft); }
.status.error { color: var(--stamp); font-weight: 700; }
.status.ok { color: var(--ok); font-weight: 700; }
.progress { height: 6px; background: var(--rule); border-radius: 99px; overflow: hidden; display: none; }
.progress.on { display: block; }
.progress span { display: block; height: 100%; width: 0; background: var(--cobalt); transition: width .2s; }

.result { display: none; border: 2px solid var(--ok); border-radius: 8px; padding: 1rem; gap: .6rem; background: var(--sheet); }
.result.on { display: grid; }
.result p { margin: 0; overflow-wrap: anywhere; }
.result .file-out { font-weight: 700; }

/* Page viewer (sign, fill form) */
.viewer { display: grid; gap: 1.25rem; justify-items: center; margin-bottom: 1rem; }
.viewer:empty { display: none; }
.vpage { position: relative; width: 100%; max-width: 860px; background: #fff; box-shadow: 0 0 0 1px var(--rule), 0 6px 18px -10px rgba(0, 0, 0, .35); container-type: inline-size; }
.vcanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vlayer { position: absolute; inset: 0; }

/* Form fields drawn over the page */
.vlayer .ff { position: absolute; margin: 0; padding: 0 .35cqw; border: 0; border-radius: 0; background: rgba(36, 70, 199, .13); color: #000; width: auto; border-radius: 0; font-family: Helvetica, Arial, "Liberation Sans", sans-serif; line-height: 1.15; }
.vlayer .ff:hover { background: rgba(36, 70, 199, .2); }
.vlayer .ff:focus { outline: 2px solid #2446c7; outline-offset: 0; background: rgba(255, 255, 255, .85); }
.vlayer .ff:disabled { background: transparent; }
.vlayer textarea.ff { resize: none; padding-top: .3cqw; }
.vlayer select.ff { padding: 0; width: auto; }
.vlayer input.ff-checkbox, .vlayer input.ff-radio { padding: 0; accent-color: #2446c7; cursor: pointer; }

/* Signature panel */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); }
.tabs button { font: inherit; background: none; border: 0; border-bottom: 3px solid transparent; padding: .45rem .7rem; color: var(--ink-soft); cursor: pointer; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--cobalt); font-weight: 700; }
[data-panel] { display: grid; gap: .6rem; }
#sig-pad { display: block; width: 100%; height: 150px; background: #fff; border: 1px solid var(--rule); border-radius: 6px; touch-action: none; cursor: crosshair; }
.pad-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.pad-row small { color: var(--ink-soft); font-size: .85rem; }
#sig-type-preview { min-height: 64px; display: grid; align-items: center; padding: .25rem .75rem; background: #fff; border: 1px solid var(--rule); border-radius: 6px; font-size: 2.2rem; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#sig-upload-preview { max-height: 90px; width: auto; background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: .25rem; }
.font-choice span { font-size: 1.35rem; line-height: 1.2; }
.place-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Items placed on a page */
.ov { position: absolute; outline: 1.5px dashed #2446c7; outline-offset: 2px; touch-action: none; user-select: none; }
.ov:focus-visible { outline: 2px solid #2446c7; }
.ov-image { cursor: move; }
.ov-image img { display: block; width: 100%; height: auto; pointer-events: none; }
.ov-text { white-space: pre; line-height: 1.15; font-family: Helvetica, Arial, "Liberation Sans", sans-serif; }
.ov-edit { display: block; min-width: 1ch; outline: none; cursor: text; user-select: text; -webkit-user-select: text; }
.ov-grip, .ov-del, .ov-resize { position: absolute; font: 700 14px/1 var(--body); }
.ov-grip { left: -30px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; background: #2446c7; color: #fff; border-radius: 4px; cursor: move; touch-action: none; }
.ov-del { top: -15px; right: -15px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: #b8322a; color: #fff; cursor: pointer; }
.ov-resize { right: -9px; bottom: -9px; width: 18px; height: 18px; background: #2446c7; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; touch-action: none; }

/* Ads */
.ad-slot { margin: 1.5rem 0; min-height: 100px; display: grid; place-items: center; }
.ad-slot:empty, .ad-slot[hidden] { display: none; }
.ad-label { font-size: .75rem; color: var(--ink-soft); text-align: center; }

/* Long-form content */
.content { padding: 2.5rem 0 3.5rem; border-top: 1px solid var(--rule); }
.content .wrap > * { max-width: 70ch; }
.content h2 { font: 800 1.75rem/1.15 var(--display); font-stretch: 110%; margin: 2.2rem 0 .7rem; }
.content h2:first-child { margin-top: 0; }
.content h3 { font: 700 1.15rem/1.3 var(--display); margin: 1.5rem 0 .3rem; }
.content ol { padding-left: 1.3rem; }
.content li { margin: .35rem 0; }
.content details { border-bottom: 1px solid var(--rule); padding: .8rem 0; }
.content summary { cursor: pointer; font-weight: 700; }
.content details p { margin: .5rem 0 0; color: var(--ink-soft); }
.related { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.related a { display: inline-block; padding: .4rem .8rem; border: 1px solid var(--rule); border-radius: 99px; text-decoration: none; color: var(--ink); font-size: .95rem; }
.related a:hover { border-color: var(--ink-soft); }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 2rem 0 2.5rem; color: var(--ink-soft); font-size: .92rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-foot nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.site-foot a { color: var(--ink-soft); }

@media (max-width: 600px) {
  .site-nav a:not(:nth-last-child(-n+2)) { display: none; }
  .sheet { padding: 2.5rem 1rem 1rem; }
  .hero { padding-top: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.ov-text .ov-del { top: auto; bottom: calc(100% + 6px); right: -8px; }
.ov-text .ov-resize { right: -24px; bottom: -4px; }

/* Guides */
.crumbs { margin: 0 0 .6rem; font-size: .95rem; }
.crumbs a { color: var(--ink-soft); }
.hero h1.guide-h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); max-width: 22ch; }
.hero p.article-meta { margin-top: .8rem; font-size: .92rem; }
.article { border-top: 0; padding-top: 1rem; }
.article p, .article li { line-height: 1.7; }
.article em { font-style: italic; }
.tool-cta { margin: 2.5rem 0; padding: 1.4rem 1.5rem; background: var(--sheet); border-left: 5px solid var(--cobalt); border-radius: 4px; box-shadow: var(--shadow); display: grid; gap: .6rem; justify-items: start; }
.tool-cta p { margin: 0; }
.tool-cta .cta-title { font: 800 1.35rem/1.2 var(--display); font-stretch: 110%; }
.guide-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.guide-list li { margin: 0; border-bottom: 1px solid var(--rule); }
.guide-list a { display: grid; gap: .25rem; padding: 1rem 0; text-decoration: none; color: var(--ink); }
.guide-list a:hover .g-title { text-decoration: underline; }
.guide-list .g-title { font: 700 1.15rem/1.3 var(--display); font-stretch: 106%; }
.guide-list .g-dek { color: var(--ink-soft); font-size: .97rem; line-height: 1.5; }
.guide-links { padding-left: 1.2rem; }
