:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --accent: #0f766e;
  --accent-hover: #0d5e58;
  --accent-soft: #f0fdfa;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #059669;
  --success-soft: #ecfdf5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.09);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg: #090e1a;
  --surface: #111827;
  --surface-alt: #1e293b;
  --border: #273449;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-soft: rgba(20, 184, 166, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0f766e, #0284c7);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
}

.nav-actions { display: flex; align-items: center; gap: 10px; }

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-soft);
  padding: 5px 11px;
  border-radius: 999px;
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #0284c7);
  padding: 5px 12px;
  border-radius: 999px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-alt); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
.btn-danger:hover { background: var(--danger-soft); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* Hero */
.hero {
  text-align: center;
  padding: 52px 24px 36px;
  max-width: 840px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 14px 0 14px;
  font-weight: 850;
}

.hero p {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 auto 28px;
  max-width: 660px;
}

.dropzone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 40px 24px;
  max-width: 680px;
  margin: 0 auto;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone-icon { font-size: 36px; margin-bottom: 10px; }
.dropzone h2 { margin: 0 0 6px; font-size: 18px; }
.dropzone p { margin: 0 0 18px; font-size: 14px; color: var(--text-subtle); }
.dropzone-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.supported-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Editor Workspace */
.workspace-wrap {
  max-width: 1280px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

.workspace-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.file-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); }
.file-meta strong { color: var(--text); }

.toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.verified-banner {
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
  color: var(--success);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-block {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.panel-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.pii-checks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 10px;
}
.pii-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
}
.pii-checks input { accent-color: var(--accent); }

.color-row {
  display: flex;
  gap: 8px;
}
.color-opt {
  flex: 1;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.color-opt.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.redaction-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.redaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  background: var(--surface-alt);
  border-radius: 7px;
  font-size: 12px;
}
.redaction-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.redaction-item button {
  border: none;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
  padding: 2px 5px;
}

.meta-table { font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.meta-table code { font-size: 11px; color: var(--text); }

/* Canvas Stage */
.stage-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stage-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-alt);
}

.pager { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }

.stage-hint { font-size: 12px; color: var(--text-subtle); }

.canvas-scroll {
  background: #cbd5e1;
  padding: 24px;
  display: flex;
  justify-content: safe center;
  align-items: flex-start;
  overflow: auto;
  min-height: 620px;
  max-height: 78vh;
}
[data-theme="dark"] .canvas-scroll { background: #0f172a; }

.page-wrapper {
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  user-select: none;
  cursor: crosshair;
  background: #ffffff;
}

#pdfCanvas { display: block; }

.overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.redact-box {
  position: absolute;
  background: rgba(0, 0, 0, 0.88);
  border: 1.5px solid #ef4444;
  cursor: pointer;
  transition: opacity 0.1s ease;
}
.redact-box.whiteout {
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px dashed #0f766e;
}
.redact-box:hover::after {
  content: "×";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.draft-box {
  position: absolute;
  background: rgba(15, 118, 110, 0.25);
  border: 2px dashed #0f766e;
  pointer-events: none;
}

/* Marketing & SEO Sections */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section-title { text-align: center; font-size: 26px; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.02em; }
.section-sub { text-align: center; color: var(--text-muted); max-width: 620px; margin: 0 auto 34px; font-size: 15px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card p, .card li { font-size: 14px; color: var(--text-muted); }

.compare-bad { border-top: 4px solid var(--danger); }
.compare-good { border-top: 4px solid var(--success); }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; max-width: 760px; margin: 0 auto; }
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--accent); box-shadow: var(--shadow-md); }
.price-amount { font-size: 36px; font-weight: 850; margin: 8px 0 4px; }
.price-list { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.price-list li { padding: 6px 0; font-size: 14px; color: var(--text-muted); }

.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; }
.faq-item summary { font-weight: 700; font-size: 15px; cursor: pointer; }
.faq-item p { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); }

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.modal h3 { margin: 0 0 8px; font-size: 20px; }
.modal p { margin: 0 0 16px; font-size: 14px; color: var(--text-muted); }
.divider-text { text-align: center; font-size: 12px; color: var(--text-subtle); margin: 18px 0 12px; }
.email-row { display: flex; gap: 8px; }
.email-input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 200;
}

footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-subtle);
}

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .privacy-pill { display: none; }
}
