﻿/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Variables */
:root {
  --bg: #e8ecf1; --sd: #c5cad3; --sl: #ffffff;
  --accent: #5b6af0; --accent2: #7b8af5;
  --text1: #3a3f58; --text2: #7a7f96; --text3: #a0a5b8;
  --danger: #e05a6a; --success: #4caf7d; --warn: #f0a832;
  --r: 16px; --rs: 10px; --rx: 6px;
}
[data-theme="dark"] {
  --bg: #1e2130; --sd: #14161f; --sl: #282d42;
  --accent: #7b8af5; --accent2: #9aa5f8;
  --text1: #d4d8f0; --text2: #8890b0; --text3: #50586a;
  --danger: #e87080; --success: #5dbe8e;
}

/* Body */
html, body { min-height: 100vh; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg); color: var(--text1);
  transition: background 0.3s ease, color 0.3s ease;
  line-height: 1.6;
}

/* Neumorphic raised/inset utilities */
.neu    { background: var(--bg); border-radius: var(--r);  box-shadow: 6px 6px 14px var(--sd), -6px -6px 14px var(--sl); }
.neu-sm { background: var(--bg); border-radius: var(--rs); box-shadow: 4px 4px 10px var(--sd), -4px -4px 10px var(--sl); }
.neu-xs { background: var(--bg); border-radius: var(--rx); box-shadow: 3px 3px 7px var(--sd), -3px -3px 7px var(--sl); }
.neu-in    { background: var(--bg); border-radius: var(--r);  box-shadow: inset 4px 4px 10px var(--sd), inset -4px -4px 10px var(--sl); }
.neu-in-sm { background: var(--bg); border-radius: var(--rs); box-shadow: inset 3px 3px 7px var(--sd), inset -3px -3px 7px var(--sl); }

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  box-shadow: 0 4px 12px var(--sd);
  padding: 0 32px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  transition: background 0.3s;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-brand .logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 3px 3px 8px var(--sd), -2px -2px 6px var(--sl);
}
.nav-brand .logo-mark svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-brand .brand-name { font-size: 15px; font-weight: 700; color: var(--text1); letter-spacing: -0.2px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 6px 12px; border-radius: var(--rx);
  font-size: 13px; font-weight: 500; color: var(--text2);
  text-decoration: none; transition: color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); box-shadow: inset 2px 2px 5px var(--sd), inset -2px -2px 5px var(--sl); }
.nav-right { display: flex; align-items: center; gap: 10px; }
/* Theme toggle */
.theme-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: var(--bg); cursor: pointer;
  box-shadow: 3px 3px 8px var(--sd), -3px -3px 8px var(--sl);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: box-shadow 0.15s, color 0.15s;
}
.theme-btn:hover { color: var(--accent); box-shadow: 2px 2px 6px var(--sd), -2px -2px 6px var(--sl); }
.theme-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Hamburger */
.nav-hamburger { display: none; flex-direction: column; gap: 4px; padding: 8px; cursor: pointer; background: none; border: none; }
.nav-hamburger span { display: block; width: 20px; height: 2px; background: var(--text2); border-radius: 2px; transition: 0.2s; }
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg); flex-direction: column; align-items: stretch; padding: 12px 20px 20px; box-shadow: 0 8px 20px var(--sd); gap: 2px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; }
  .nav-hamburger { display: flex; }
  nav { padding: 0 20px; position: relative; }
}

/* ── HOME PAGE ── */
.home-hero { text-align: center; padding: 56px 20px 40px; }
.home-hero .wordmark { font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }
.home-hero h1 { font-size: 36px; font-weight: 700; color: var(--text1); letter-spacing: -0.5px; margin-bottom: 10px; }
.home-hero p { font-size: 16px; color: var(--text2); max-width: 480px; margin: 0 auto; }

/* Search bar on home */
.search-wrap { max-width: 420px; margin: 32px auto 0; }
.search-box { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 50px; border-radius: 25px; box-shadow: inset 4px 4px 10px var(--sd), inset -4px -4px 10px var(--sl); }
.search-box svg { width: 16px; height: 16px; stroke: var(--text3); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.search-box input { flex: 1; background: none; border: none; outline: none; font-family: inherit; font-size: 14px; color: var(--text1); }
.search-box input::placeholder { color: var(--text3); }

/* Category sections */
.tools-container { max-width: 1100px; margin: 0 auto; padding: 0 24px 80px; }
.category-section { margin-bottom: 44px; }
.category-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text3);
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.category-title::after { content: ''; flex: 1; height: 1px; background: var(--sd); opacity: 0.5; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* Tool cards */
.tool-card {
  background: var(--bg); border-radius: var(--rs);
  box-shadow: 5px 5px 12px var(--sd), -5px -5px 12px var(--sl);
  padding: 20px 18px; cursor: pointer;
  text-decoration: none; display: block;
  transition: box-shadow 0.2s, transform 0.15s;
}
.tool-card:hover {
  box-shadow: 3px 3px 8px var(--sd), -3px -3px 8px var(--sl);
  transform: translateY(1px);
}
.tool-card:active { box-shadow: inset 2px 2px 5px var(--sd), inset -2px -2px 5px var(--sl); transform: none; }
.tool-card .tc-icon {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 2px 2px 5px var(--sd), inset -2px -2px 5px var(--sl);
}
.tool-card .tc-icon svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool-card .tc-name { font-size: 13px; font-weight: 600; color: var(--text1); margin-bottom: 4px; }
.tool-card .tc-desc { font-size: 11px; color: var(--text3); line-height: 1.5; }
.tool-card.hidden { display: none; }

/* ── TOOL PAGES ── */
.tool-page { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }
.tool-header { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 36px; }
.tool-header .th-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  box-shadow: 4px 4px 12px rgba(91,106,240,0.3), -2px -2px 8px var(--sl);
}
.tool-header .th-icon svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool-header h1 { font-size: 22px; font-weight: 700; color: var(--text1); letter-spacing: -0.3px; }
.tool-header p { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* Step labels */
.step-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text3); margin: 28px 0 12px; }

/* Drop zone */
.drop-zone {
  border-radius: var(--r); padding: 44px 32px; text-align: center; cursor: pointer;
  box-shadow: inset 4px 4px 10px var(--sd), inset -4px -4px 10px var(--sl);
  transition: box-shadow 0.2s; position: relative; user-select: none;
}
.drop-zone:hover, .drop-zone.over {
  box-shadow: inset 6px 6px 14px var(--sd), inset -6px -6px 14px var(--sl);
}
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop-zone .dz-icon {
  width: 50px; height: 50px; border-radius: 50%; margin: 0 auto 14px;
  box-shadow: 4px 4px 10px var(--sd), -4px -4px 10px var(--sl);
  display: flex; align-items: center; justify-content: center;
}
.drop-zone .dz-icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone h2 { font-size: 15px; font-weight: 600; color: var(--text1); margin-bottom: 6px; }
.drop-zone p { font-size: 12px; color: var(--text3); }

/* File list */
.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-item {
  background: var(--bg); border-radius: var(--rs);
  box-shadow: 4px 4px 10px var(--sd), -4px -4px 10px var(--sl);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
}
.fi-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  box-shadow: inset 2px 2px 5px var(--sd), inset -2px -2px 5px var(--sl);
  display: flex; align-items: center; justify-content: center;
}
.fi-icon svg { width: 14px; height: 14px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fi-meta { flex: 1; min-width: 0; }
.fi-name { font-size: 13px; font-weight: 500; color: var(--text1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-size { font-size: 11px; color: var(--text3); margin-top: 2px; }
.btn-rm {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: none;
  background: var(--bg); cursor: pointer; color: var(--text3);
  box-shadow: 2px 2px 5px var(--sd), -2px -2px 5px var(--sl);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, box-shadow 0.15s;
}
.btn-rm:hover { color: var(--danger); box-shadow: 1px 1px 3px var(--sd), -1px -1px 3px var(--sl); }
.btn-rm svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }

/* Empty state */
.empty-state { text-align: center; padding: 28px; font-size: 13px; color: var(--text3); }

/* Input fields */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text2); }
.input-wrap {
  display: flex; align-items: center; height: 46px; border-radius: var(--rs);
  box-shadow: inset 3px 3px 7px var(--sd), inset -3px -3px 7px var(--sl);
  padding: 0 14px; gap: 10px;
}
.input-wrap svg { width: 14px; height: 14px; stroke: var(--text3); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.input-wrap input, .input-wrap select {
  flex: 1; background: none; border: none; outline: none;
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--text1);
  min-width: 0;
}
.input-wrap select { appearance: none; cursor: pointer; }
.input-wrap input::placeholder { color: var(--text3); font-weight: 400; }
textarea.neu-in-sm {
  width: 100%; padding: 14px; background: var(--bg); border: none; outline: none;
  font-family: inherit; font-size: 14px; color: var(--text1); resize: vertical;
  border-radius: var(--rs);
  box-shadow: inset 3px 3px 7px var(--sd), inset -3px -3px 7px var(--sl);
}

/* Grid of fields */
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .fields-grid { grid-template-columns: 1fr; } }

/* Buttons */
.btn-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  height: 48px; border-radius: var(--rs); border: none;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: box-shadow 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary {
  flex: 1; min-width: 160px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  box-shadow: 4px 4px 12px rgba(91,106,240,0.4), -2px -2px 8px var(--sl);
  letter-spacing: 0.02em;
}
.btn-primary:hover { box-shadow: 6px 6px 16px rgba(91,106,240,0.5), -2px -2px 8px var(--sl); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-secondary {
  padding: 0 22px;
  background: var(--bg); color: var(--text2);
  box-shadow: 4px 4px 10px var(--sd), -4px -4px 10px var(--sl);
}
.btn-secondary:hover { box-shadow: 3px 3px 7px var(--sd), -3px -3px 7px var(--sl); }
.btn-ghost {
  background: none; border: none; color: var(--accent); font-family: inherit;
  font-size: 13px; font-weight: 500; cursor: pointer; padding: 4px 8px;
  border-radius: var(--rx); transition: background 0.15s;
}
.btn-ghost:hover { background: rgba(91,106,240,0.08); }

/* Option pills (radio-like) */
.option-group { display: flex; gap: 10px; flex-wrap: wrap; }
.option-pill input { display: none; }
.option-pill label {
  display: block; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
  cursor: pointer; color: var(--text2);
  box-shadow: 3px 3px 8px var(--sd), -3px -3px 8px var(--sl);
  transition: box-shadow 0.15s, color 0.15s;
}
.option-pill input:checked + label {
  color: var(--accent);
  box-shadow: inset 2px 2px 6px var(--sd), inset -2px -2px 6px var(--sl);
}

/* Range slider */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--bg); box-shadow: inset 2px 2px 5px var(--sd), inset -2px -2px 5px var(--sl); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); box-shadow: 3px 3px 7px var(--sd), -3px -3px 7px var(--sl); cursor: pointer; }

/* Checkbox */
.check-item { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-item input { display: none; }
.check-box {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  box-shadow: inset 2px 2px 5px var(--sd), inset -2px -2px 5px var(--sl);
  display: flex; align-items: center; justify-content: center;
  color: transparent; transition: color 0.15s;
}
.check-item input:checked ~ .check-box { color: var(--accent); }
.check-box svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.check-label { font-size: 13px; color: var(--text2); }

/* Progress bar */
.progress-wrap { height: 8px; border-radius: 4px; box-shadow: inset 2px 2px 4px var(--sd), inset -2px -2px 4px var(--sl); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.3s; }

/* Info box */
.info-box {
  background: var(--bg); border-radius: var(--rs);
  box-shadow: inset 2px 2px 6px var(--sd), inset -2px -2px 6px var(--sl);
  padding: 16px 18px; margin-top: 20px;
  border-left: 3px solid var(--accent);
}
.info-box p { font-size: 12px; color: var(--text2); line-height: 1.6; }
.info-box p + p { margin-top: 8px; }

/* Info pills row */
.info-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.info-pill {
  background: var(--bg); border-radius: 20px;
  box-shadow: 3px 3px 8px var(--sd), -3px -3px 8px var(--sl);
  padding: 7px 14px; font-size: 12px; color: var(--text3);
  display: flex; align-items: center; gap: 6px;
}
.info-pill svg { width: 12px; height: 12px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }

/* Page thumbnails (organize, redact, etc.) */
.thumbnails-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.thumb-item {
  background: var(--bg); border-radius: var(--rs);
  box-shadow: 4px 4px 10px var(--sd), -4px -4px 10px var(--sl);
  padding: 10px; text-align: center; cursor: grab; position: relative;
}
.thumb-item canvas { width: 100%; height: auto; border-radius: var(--rx); display: block; }
.thumb-item .thumb-label { font-size: 11px; color: var(--text3); margin-top: 6px; }
.thumb-item .thumb-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.thumb-item .thumb-btn {
  width: 22px; height: 22px; border-radius: 5px; border: none; cursor: pointer;
  background: var(--bg); color: var(--text2); font-size: 11px;
  box-shadow: 2px 2px 4px var(--sd), -2px -2px 4px var(--sl);
  display: flex; align-items: center; justify-content: center;
}
.thumb-item .thumb-btn:hover { color: var(--accent); }
.thumb-item .thumb-btn svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.thumb-item.selected { box-shadow: inset 2px 2px 6px var(--sd), inset -2px -2px 6px var(--sl); }

/* Canvas overlay tool (redact, fill-sign) */
.canvas-wrap { position: relative; display: inline-block; width: 100%; }
.canvas-wrap canvas { width: 100%; display: block; border-radius: var(--rs); }
.canvas-wrap .overlay-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: crosshair; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; z-index: 999;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg); border-radius: var(--rs);
  box-shadow: 6px 6px 16px var(--sd), -6px -6px 16px var(--sl);
  padding: 13px 22px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 9px;
  opacity: 0; pointer-events: none; white-space: nowrap;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { color: var(--success); }
.toast.error   { color: var(--danger); }
.toast.info    { color: var(--accent); }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* Overlay */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(232,236,241,0.75); backdrop-filter: blur(4px);
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
[data-theme="dark"] .overlay { background: rgba(30,33,48,0.8); }
.overlay.active { display: flex; }
.overlay p { font-size: 14px; font-weight: 500; color: var(--text2); }
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  box-shadow: 4px 4px 10px var(--sd), -4px -4px 10px var(--sl);
  position: relative;
}
.spinner::after {
  content: ''; position: absolute; inset: 6px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--accent);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
footer { text-align: center; padding: 24px; font-size: 12px; color: var(--text3); border-top: 1px solid var(--sd); margin-top: 40px; }

/* Responsive */
@media (max-width: 600px) {
  .tool-page { padding: 28px 16px 60px; }
  .btn-row { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; flex: none; }
  .home-hero { padding: 36px 16px 28px; }
  .home-hero h1 { font-size: 26px; }
  .tools-container { padding: 0 16px 60px; }
}

