/* Inter (variable weight), self-hosted. latin-ext covers accented European languages; browsers
   only download it when a page uses those characters. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../lib/inter/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../lib/inter/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* PdfTools theme on Bootstrap 5.3. Colours use Bootstrap's CSS variables so light and dark
   mode (data-bs-theme on <html>) both work without duplicating rules. */

:root {
  --accent: #e5322d;
  --accent-hover: #c8231f;
  --accent-soft: rgba(229, 50, 45, .1);
  --radius: 1rem;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 .75rem 2rem -.75rem rgba(16, 24, 40, .18);
  --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 229, 50, 45;
  --bs-link-hover-color: var(--accent-hover);
  --bs-link-hover-color-rgb: 200, 35, 31;
}

[data-bs-theme="light"] {
  --bs-body-bg: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #f1f3f6;
  --hero-from: #fff5f4;
  --hero-to: #f7f8fa;
}

[data-bs-theme="dark"] {
  --bs-body-bg: #0f1218;
  --bs-body-color: #d7dbe2;
  --bs-border-color: #262c37;
  --surface: #171b23;
  --surface-alt: #1e232d;
  --hero-from: #1d1416;
  --hero-to: #0f1218;
  --accent-soft: rgba(229, 50, 45, .18);
  --shadow: 0 .75rem 2rem -.75rem rgba(0, 0, 0, .6);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Keep in-page anchors (#tools) from landing under the sticky header. */
[id] {
  scroll-margin-top: 5.5rem;
}

main {
  flex: 1;
  padding-bottom: 4rem;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -.02em;
}

/* Buttons */

.btn {
  font-weight: 600;
  border-radius: .65rem;
}

.btn-accent {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--accent-hover);
  --bs-btn-active-border-color: var(--accent-hover);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
  box-shadow: 0 .5rem 1rem -.5rem rgba(229, 50, 45, .6);
}

.btn-outline-accent {
  --bs-btn-color: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--accent-hover);
  --bs-btn-active-border-color: var(--accent-hover);
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
  background: var(--surface);
}

.btn-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
}

[data-bs-theme="light"] .theme-icon-dark,
[data-bs-theme="dark"] .theme-icon-light {
  display: none;
}

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 .25rem var(--accent-soft);
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* Header */

.site-header {
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--bs-border-color);
}

.site-header .navbar {
  padding: .75rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.02em;
  color: var(--bs-emphasis-color);
  text-decoration: none;
}

.brand:hover {
  color: var(--bs-emphasis-color);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: .6rem;
  background: linear-gradient(135deg, #ff5a4f, var(--accent));
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 .4rem .9rem -.4rem rgba(229, 50, 45, .7);
}

.site-header .nav-link {
  font-weight: 500;
  color: var(--bs-secondary-color);
  border-radius: .5rem;
  padding: .45rem .75rem !important;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
  color: var(--accent);
}

.tools-menu {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  padding: .5rem;
  min-width: 18rem;
  background: var(--surface);
}

.tools-menu-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  border-radius: .6rem;
  padding: .5rem .6rem;
  font-weight: 500;
}

.tools-menu-item:hover {
  background: var(--surface-alt);
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 5rem 0 4rem;
  background: radial-gradient(60rem 30rem at 50% -10%, var(--hero-from), var(--hero-to));
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .35;
  pointer-events: none;
}

.hero::before {
  width: 22rem;
  height: 22rem;
  background: #ff8a65;
  top: -8rem;
  left: -6rem;
}

.hero::after {
  width: 18rem;
  height: 18rem;
  background: #7b5cd6;
  bottom: -10rem;
  right: -4rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  max-width: 48rem;
  margin: 1rem auto 0;
  color: var(--bs-emphasis-color);
}

.hero .lead {
  color: var(--bs-secondary-color);
  max-width: 38rem;
  margin: 1rem auto 0;
  font-size: 1.15rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .9rem;
  border-radius: 2rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: .85rem;
}

.hero-badges {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem 2rem;
  color: var(--bs-secondary-color);
  font-size: .95rem;
}

.hero-badges i {
  color: var(--accent);
  margin-right: .3rem;
}

.tool-hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.tool-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-top: 1rem;
  color: var(--bs-emphasis-color);
}

.tool-hero .lead {
  color: var(--bs-secondary-color);
  max-width: 40rem;
  margin: .5rem auto 0;
}

/* Sections */

.section {
  margin-top: 4rem;
}

.section-head {
  text-align: center;
  margin-bottom: 2rem;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.section-head p {
  color: var(--bs-secondary-color);
  max-width: 36rem;
  margin: .5rem auto 0;
}

/* Tool cards and icons */

.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: .85rem;
  font-size: 1.4rem;
  color: var(--tool-color);
  background: color-mix(in srgb, var(--tool-color) 14%, transparent);
}

.tool-icon.sm {
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1rem;
  border-radius: .55rem;
}

.tool-icon.lg {
  width: 4.25rem;
  height: 4.25rem;
  font-size: 2rem;
  border-radius: 1.1rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--tool-color) 45%, var(--bs-border-color));
  color: inherit;
}

.tool-card h3 {
  font-size: 1.15rem;
  margin: 1rem 0 .4rem;
  color: var(--bs-emphasis-color);
}

.tool-card p {
  color: var(--bs-secondary-color);
  font-size: .93rem;
  margin: 0 0 1rem;
  flex: 1;
}

.tool-card-cta {
  font-weight: 600;
  font-size: .9rem;
  color: var(--tool-color);
}

.tool-card-cta i {
  transition: transform .15s ease;
}

.tool-card:hover .tool-card-cta i {
  transform: translateX(3px);
}

/* Steps and features */

.step,
.feature {
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.step h3,
.feature h3 {
  font-size: 1.15rem;
  margin: 1rem 0 .4rem;
}

.step p,
.feature p {
  color: var(--bs-secondary-color);
  margin: 0;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.feature i {
  font-size: 1.8rem;
  color: var(--accent);
}

.cta-band {
  margin-top: 4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.5rem;
  border-radius: calc(var(--radius) * 1.5);
  color: #fff;
  background: linear-gradient(120deg, #e5322d, #b4207a 60%, #6d3fd0);
}

.cta-band h2 {
  margin: 0 0 .25rem;
}

.cta-band p {
  opacity: .85;
}

/* Tool page */

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 991.98px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 3.5rem 1rem;
  background: var(--surface);
  border: 2px dashed color-mix(in srgb, var(--tool-color) 35%, var(--bs-border-color));
  border-radius: calc(var(--radius) * 1.25);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--tool-color);
  background: color-mix(in srgb, var(--tool-color) 5%, var(--surface));
}

.dropzone-icon {
  font-size: 2.75rem;
  color: var(--tool-color);
  line-height: 1;
}

.dropzone-button {
  background: var(--tool-color);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  padding: .9rem 2.25rem;
  border-radius: .75rem;
  box-shadow: 0 .6rem 1.2rem -.6rem var(--tool-color);
}

.dropzone-hint {
  color: var(--bs-secondary-color);
}

.dropzone-limits {
  color: var(--bs-tertiary-color);
  font-size: .85rem;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: .5rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  padding: .65rem .8rem;
}

.file-item::before {
  content: "\F63B"; /* bi-file-earmark */
  font-family: "bootstrap-icons";
  color: var(--bs-secondary-color);
}

.file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.file-size {
  color: var(--bs-tertiary-color);
  font-size: .85rem;
  white-space: nowrap;
}

.file-item button {
  border: 0;
  background: transparent;
  color: var(--bs-secondary-color);
  width: 2rem;
  height: 2rem;
  border-radius: .45rem;
}

.file-item button:hover:not(:disabled) {
  background: var(--surface-alt);
  color: var(--bs-emphasis-color);
}

.file-item button:disabled {
  opacity: .3;
}

.order-hint {
  color: var(--bs-tertiary-color);
  font-size: .85rem;
  margin-top: .5rem;
}

.options {
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.options h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.option-card {
  padding: .6rem .6rem .6rem 2.2rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .65rem;
  margin-bottom: .5rem;
}

.option-card:has(:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.progress-wrap {
  margin-top: 1rem;
}

.progress-bar {
  background: var(--accent);
}

.result {
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: calc(var(--radius) * 1.25);
  padding: 2.5rem 1rem;
  text-align: center;
}

.result-icon {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgba(46, 158, 91, .15);
  color: #2e9e5b;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.result h2 {
  font-weight: 800;
  font-size: 1.6rem;
}

/* Rich content (tool how-to, CMS pages) */

.content-card {
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin-top: 2rem;
}

.prose {
  font-size: 1.02rem;
  line-height: 1.7;
}

.prose h2 {
  font-size: 1.35rem;
  margin: 1.75rem 0 .75rem;
}

.prose h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 .5rem;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: .5rem;
}

.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }
.prose .ql-align-justify { text-align: justify; }

/* Breadcrumbs */

.crumbs ol {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem;
  font-size: .85rem;
  color: var(--bs-tertiary-color);
}

.crumbs li + li::before {
  content: "/";
  margin-right: .35rem;
  opacity: .6;
}

.crumbs a {
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--accent);
}

/* FAQ */

.faq h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.faq .accordion {
  --bs-accordion-bg: transparent;
  --bs-accordion-active-bg: transparent;
  --bs-accordion-active-color: var(--accent);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--accent-soft);
}

.faq .accordion-button {
  font-weight: 600;
  padding-left: 0;
  padding-right: 0;
}

.faq .accordion-body {
  padding: 0 0 1rem;
  color: var(--bs-secondary-color);
}

.faq .accordion-body p:last-child {
  margin-bottom: 0;
}

.faq-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

.faq-row:first-child {
  padding-top: 0;
}

.faq-row:last-child {
  border-bottom: 0;
  margin-bottom: 1rem;
}

/* Customer account pages */

.auth-page {
  display: grid;
  place-items: center;
  padding: 3rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: calc(var(--radius) * 1.25);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.account-page .plan-price {
  font-size: 1.5rem;
}

.delete-account summary {
  cursor: pointer;
}

.delete-account form {
  max-width: 26rem;
}

/* Pricing: monthly / yearly switch */

.billing-toggle {
  display: inline-flex;
  margin-top: 1.5rem;
  padding: .25rem;
  border-radius: 2rem;
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
}

.billing-toggle button {
  border: 0;
  background: none;
  padding: .45rem 1.1rem;
  border-radius: 2rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.billing-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.save-chip {
  font-size: .7rem;
  padding: .1rem .4rem;
  border-radius: 1rem;
  background: rgba(46, 158, 91, .15);
  color: #2e9e5b;
  margin-left: .25rem;
}

.billing-toggle button.active .save-chip {
  background: rgba(255, 255, 255, .25);
  color: #fff;
}

/* Pro badge and upgrade page */

.pro-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .1rem .45rem;
  border-radius: 1rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(120deg, #e5322d, #6d3fd0);
  vertical-align: middle;
}

.pro-chip.lg {
  font-size: .8rem;
  padding: .3rem .8rem;
}

.tool-card .pro-chip {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.tool-card {
  position: relative;
}

.pro-upsell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: calc(var(--radius) * 1.5);
  padding: clamp(1.5rem, 4vw, 3rem);
}

@media (max-width: 767.98px) {
  .pro-upsell {
    grid-template-columns: 1fr;
  }

  .pro-upsell-art {
    display: none;
  }
}

.pro-upsell h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 1rem 0 .5rem;
}

.pro-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: .6rem;
}

.pro-features i {
  color: var(--tool-color);
  margin-right: .5rem;
}

.mock-page {
  aspect-ratio: 0.77;
  max-width: 320px;
  margin: 0 auto;
  background: #fff;
  border-radius: .5rem;
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transform: rotate(-2deg);
}

.mock-line {
  height: .5rem;
  border-radius: 1rem;
  background: #e5e7eb;
}

.mock-text {
  color: #0d9488;
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px dashed #0d9488;
  border-radius: .35rem;
  padding: .1rem .5rem;
  align-self: flex-start;
}

.mock-highlight {
  height: .9rem;
  width: 70%;
  border-radius: .2rem;
  background: rgba(253, 224, 71, .7);
}

.mock-signature {
  margin-top: auto;
  align-self: flex-end;
  font-family: "Brush Script MT", cursive;
  font-size: 1.8rem;
  color: #1d4ed8;
  border-bottom: 1px solid #9ca3af;
  padding: 0 .5rem;
}

/* PDF editor */

.pdf-editor {
  --ed-accent: #0d9488;
}

.ed-workspace {
  display: flex;
  flex-direction: column;
  height: min(85vh, 1000px);
  min-height: 520px;
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.ed-toolbar,
.ed-props {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--bs-border-color);
  overflow-x: auto;
  scrollbar-width: thin;
}

.ed-props {
  min-height: 3rem;
  background: var(--surface-alt);
}

.ed-group {
  display: flex;
  align-items: center;
  gap: .15rem;
  padding-right: .5rem;
  border-right: 1px solid var(--bs-border-color);
  flex-shrink: 0;
}

.ed-group:last-child,
.ed-group.ms-auto {
  border-right: 0;
  padding-right: 0;
  gap: .4rem;
}

.ed-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: 2.25rem;
  min-width: 2.25rem;
  justify-content: center;
  padding: 0 .55rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: var(--bs-body-color);
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
}

.ed-btn i {
  font-size: 1.05rem;
}

.ed-btn:hover:not(:disabled) {
  background: var(--surface-alt);
}

.ed-btn.active {
  background: color-mix(in srgb, var(--ed-accent) 15%, transparent);
  color: var(--ed-accent);
}

.ed-btn:disabled {
  opacity: .35;
}

@media (max-width: 1199.98px) {
  .ed-btn span {
    display: none;
  }
}

.ed-zoom-label {
  min-width: 3.2rem;
  text-align: center;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

.ed-prop {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}

.ed-prop input[type="color"] {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: .4rem;
  background: none;
}

.ed-prop .form-select {
  width: auto;
}

.ed-prop input[type="range"] {
  width: 6rem;
}

.ed-hint {
  font-size: .85rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

.ed-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.ed-thumbs {
  width: 150px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: .75rem;
  border-right: 1px solid var(--bs-border-color);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

@media (max-width: 767.98px) {
  .ed-thumbs {
    display: none;
  }
}

.ed-thumb {
  border: 2px solid transparent;
  border-radius: .4rem;
  background: none;
  padding: 0;
  text-align: center;
  color: var(--bs-secondary-color);
  font-size: .75rem;
}

.ed-thumb canvas {
  display: block;
  width: 100%;
  background: #fff;
  border-radius: .25rem;
  box-shadow: var(--shadow-sm);
}

.ed-thumb.active {
  border-color: var(--ed-accent);
  color: var(--ed-accent);
}

.ed-viewport {
  flex: 1;
  overflow: auto;
  background: var(--surface-alt);
}

.ed-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  width: max-content;
  min-width: 100%;
}

.ed-page {
  position: relative;
  background: #fff;
  box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .15);
  flex-shrink: 0;
}

.ed-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ed-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.ed-pages[data-tool="text"] .ed-layer { cursor: text; }
.ed-pages:not([data-tool="select"]):not([data-tool="text"]) .ed-layer { cursor: crosshair; }

.ed-obj {
  position: absolute;
  box-sizing: border-box;
}

div.ed-obj {
  cursor: move;
}

.ed-text {
  white-space: pre;
  line-height: 1.2;
  min-width: 1ch;
  min-height: 1.2em;
  outline: none;
}

.ed-text:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
}

.ed-text.is-editing {
  cursor: text;
  user-select: text;
  outline: 1px dashed var(--ed-accent);
  outline-offset: 2px;
}

.ed-whiteout {
  background: #fff;
}

/* Edit text: outlines on the PDF's own lines of text, shown only while the tool is active. */
.ed-run {
  position: absolute;
  display: none;
  border-radius: 2px;
  cursor: text;
}

.ed-pages[data-tool="edittext"] .ed-run {
  display: block;
  outline: 1px dashed color-mix(in srgb, var(--ed-accent) 45%, transparent);
}

/* In Select mode the PDF's own lines can be dragged too; outline only on hover. */
.ed-pages[data-tool="select"] .ed-run {
  display: block;
  cursor: move;
}

.ed-pages[data-tool="select"] .ed-run:hover,
.ed-pages[data-tool="edittext"] .ed-run:hover {
  outline: 2px solid var(--ed-accent);
  background: color-mix(in srgb, var(--ed-accent) 8%, transparent);
}

.ed-edit {
  overflow: visible;
  cursor: move;
}

.ed-pages[data-tool="edittext"] .ed-edit {
  cursor: text;
}

.ed-edit-text {
  position: absolute;
  white-space: pre;
  line-height: 1.2;
  min-width: 1ch;
  outline: none;
}

.ed-edit-text.is-editing {
  outline: 1px dashed var(--ed-accent);
  outline-offset: 2px;
  user-select: text;
}

/* Outlines for an edited line go around its text, which can be dragged away from the patch that
   hides the original; the patch itself stays unmarked so it looks like plain page. */
.ed-obj.ed-edit.is-selected {
  outline: none;
}

.ed-edit.is-selected .ed-edit-text {
  outline: 2px solid var(--ed-accent);
  outline-offset: 2px;
}

.ed-pages[data-tool="edittext"] .ed-edit:not(.is-selected) .ed-edit-text {
  outline: 1px dashed color-mix(in srgb, var(--ed-accent) 45%, transparent);
  outline-offset: 2px;
}

.ed-rect {
  border-style: solid;
}

.ed-ellipse {
  border-style: solid;
  border-radius: 50%;
}

.ed-highlight {
  mix-blend-mode: multiply;
}

.ed-image img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

svg.ed-obj {
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}

svg.ed-obj path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.ed-obj .ed-hit {
  pointer-events: stroke;
  cursor: move;
}

.ed-obj.is-selected:not(svg) {
  outline: 2px solid var(--ed-accent);
  outline-offset: 1px;
}

.ed-whiteout.is-selected {
  outline-style: dashed !important;
}

svg.ed-obj.is-selected .ed-stroke {
  filter: drop-shadow(0 0 2px var(--ed-accent));
}

.ed-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ed-accent);
  cursor: nwse-resize;
}

.ed-handle-dot {
  fill: #fff;
  stroke: var(--ed-accent);
  stroke-width: 2;
  pointer-events: all;
  cursor: grab;
}

.ed-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .35rem .75rem;
  border-top: 1px solid var(--bs-border-color);
  font-size: .8rem;
  color: var(--bs-secondary-color);
}

.sig-pad {
  display: block;
  width: 100%;
  height: 200px;
  border: 1px dashed var(--bs-border-color);
  border-radius: .5rem;
  background: #fff;
  touch-action: none;
}

.sig-ink {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--bs-border-color);
}

.sig-ink.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--ed-accent);
}

.sig-font.active {
  background: color-mix(in srgb, var(--ed-accent) 15%, transparent);
  border-color: var(--ed-accent);
  color: var(--ed-accent);
}

[data-sig-font="Dancing Script"] { font-family: "Dancing Script", cursive; font-size: 1.15rem; }
[data-sig-font="Caveat"] { font-family: "Caveat", cursive; font-size: 1.2rem; }

/* Cookie banner */

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  max-width: 960px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  box-shadow: 0 1rem 3rem rgba(16, 24, 40, .25);
  padding: 1.25rem 1.5rem;
}

.cookie-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
}

.cookie-copy {
  flex: 1 1 420px;
}

.cookie-copy h2 {
  font-size: 1.05rem;
  margin-bottom: .35rem;
}

.cookie-copy p {
  font-size: .9rem;
  color: var(--bs-secondary-color);
  margin: 0;
}

.cookie-details {
  margin-top: 1rem;
  display: grid;
  gap: .6rem;
  font-size: .9rem;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

@media (max-width: 575.98px) {
  .cookie-actions .btn {
    flex: 1 1 auto;
  }
}

/* Contact form: honeypot kept off-screen rather than display:none, which some bots detect. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.message-text {
  white-space: pre-wrap;
  background: var(--surface-alt);
  border-radius: .5rem;
  padding: 1rem;
}

.admin-nav a .badge {
  margin-left: auto;
}

.qr-code {
  background: #fff;
  padding: .5rem;
  border-radius: .75rem;
  border: 1px solid var(--bs-border-color);
}

.setup-key {
  display: inline-block;
  font-size: 1rem;
  letter-spacing: .05em;
  word-spacing: .3em;
  margin-top: .25rem;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

.recovery-codes code {
  display: block;
  text-align: center;
  font-size: 1rem;
  padding: .5rem;
  border-radius: .5rem;
  background: var(--surface-alt);
  color: var(--bs-emphasis-color);
}

/* Ads */

.ad-slot {
  position: relative;
  margin: 1.5rem auto;
  text-align: center;
}

.ad-top,
.ad-bottom,
.ad-incontent {
  max-width: 970px;
  min-height: 90px;
}

.ad-side {
  min-height: 250px;
}

.ad-label {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--bs-tertiary-color);
  margin-bottom: .25rem;
}

.ad-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed var(--bs-border-color);
  border-radius: .75rem;
  color: var(--bs-tertiary-color);
  font-size: .85rem;
  background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(127, 127, 127, .05) 8px, rgba(127, 127, 127, .05) 16px);
}

/* Pricing */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.plan {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: calc(var(--radius) * 1.25);
  padding: 2rem;
}

.plan.featured {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
}

.plan-flag {
  position: absolute;
  top: -.8rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .8rem;
  border-radius: 2rem;
}

.plan-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--bs-emphasis-color);
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
}

.plan li {
  margin-bottom: .6rem;
  color: var(--bs-secondary-color);
}

.plan li i {
  color: var(--accent);
  margin-right: .4rem;
}

/* Error page */

.error-page {
  text-align: center;
  padding: 6rem 0;
}

.error-code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(120deg, #e5322d, #6d3fd0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--bs-border-color);
  background: var(--surface);
  padding: 3.5rem 0 1.5rem;
  font-size: .93rem;
}

.footer-heading {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--bs-tertiary-color);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: .5rem;
}

.footer-links a {
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bs-border-color);
  color: var(--bs-tertiary-color);
  font-size: .85rem;
}

/* ---------- Admin area ---------- */

.admin-body {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
}

.admin-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--bs-border-color);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-nav {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  flex: 1;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .8rem;
  border-radius: .6rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: .15rem;
}

.admin-nav a:hover {
  background: var(--surface-alt);
  color: var(--bs-emphasis-color);
}

.admin-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem;
}

.admin-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.admin-topbar h1 {
  font-size: 1.6rem;
  margin: 0;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-card h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.admin-card .table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  height: 100%;
}

.stat-label {
  color: var(--bs-secondary-color);
  font-size: .85rem;
  font-weight: 500;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--bs-emphasis-color);
}

.stat i {
  float: right;
  font-size: 1.4rem;
  color: var(--accent);
}

.bar-track {
  height: .5rem;
  border-radius: 1rem;
  background: var(--surface-alt);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 1rem;
}

.rich-editor {
  background: var(--bs-body-bg);
  border-radius: 0 0 .5rem .5rem;
  min-height: 320px;
}

.ql-toolbar.ql-snow {
  border-radius: .5rem .5rem 0 0;
  border-color: var(--bs-border-color) !important;
  background: var(--surface-alt);
}

.ql-container.ql-snow {
  border-color: var(--bs-border-color) !important;
  font-family: inherit;
  font-size: 1rem;
}

[data-bs-theme="dark"] .ql-snow .ql-stroke { stroke: #c9ced6; }
[data-bs-theme="dark"] .ql-snow .ql-fill { fill: #c9ced6; }
[data-bs-theme="dark"] .ql-snow .ql-picker { color: #c9ced6; }
[data-bs-theme="dark"] .ql-snow .ql-picker-options { background: var(--surface); }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(50rem 25rem at 50% 0%, var(--hero-from), var(--hero-to));
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--bs-border-color);
  border-radius: calc(var(--radius) * 1.25);
  padding: 2rem;
  box-shadow: var(--shadow);
}

@media (max-width: 991.98px) {
  .admin-body {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--bs-border-color);
  }

  .admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-top: 1rem;
  }
}
