/* ─── WITHPDF TOOLS — STYLESHEET ─────────────────────────────────────────── */

:root {
  --red:       #E8352A;
  --red-dark:  #C42B21;
  --red-light: #FFF0EF;
  --dark:      #1A1A1A;
  --mid:       #555555;
  --muted:     #999999;
  --border:    #E5E5E5;
  --bg:        #F7F7F7;
  --white:     #FFFFFF;
  --success:   #22C55E;
  --radius:    10px;
  --shadow:    0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── NAV ────────────────────────────────────────────────────────────────── */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--red);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.nav-logo span { color: var(--dark); }
.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--mid);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--red-light);
  color: var(--red);
}

/* ─── HERO / TOOL HEADER ─────────────────────────────────────────────────── */
.tool-hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 40px 24px 32px;
  text-align: center;
}
.tool-hero .tool-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
  background: var(--red-light);
}
.tool-hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--dark);
  margin-bottom: 8px;
}
.tool-hero p {
  font-size: 0.95rem;
  color: var(--mid);
  max-width: 480px;
  margin: 0 auto;
}

/* ─── MAIN CONTAINER ─────────────────────────────────────────────────────── */
.container {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 16px;
}

/* ─── DROP ZONE ──────────────────────────────────────────────────────────── */
.dropzone {
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--red);
  background: var(--red-light);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}
.dropzone h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--dark);
}
.dropzone p {
  font-size: 0.85rem;
  color: var(--muted);
}
.dropzone .btn-pick {
  display: inline-block;
  margin-top: 16px;
  padding: 9px 22px;
  background: var(--red);
  color: var(--white);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
}

/* ─── FILE LIST ──────────────────────────────────────────────────────────── */
.file-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.file-item .file-icon { font-size: 1.3rem; flex-shrink: 0; }
.file-item .file-info { flex: 1; min-width: 0; }
.file-item .file-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-item .file-size { font-size: 0.78rem; color: var(--muted); }
.file-item .file-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
}
.file-item .file-remove:hover { color: var(--red); background: var(--red-light); }

/* ─── OPTIONS CARD ───────────────────────────────────────────────────────── */
.options-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}
.options-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}
.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.option-row:last-child { margin-bottom: 0; }
.option-row label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--dark);
  min-width: 120px;
}
.option-row select,
.option-row input[type="text"],
.option-row input[type="password"],
.option-row input[type="number"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.88rem;
  font-family: var(--font);
  color: var(--dark);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.option-row select:focus,
.option-row input:focus {
  border-color: var(--red);
  background: var(--white);
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
  width: 100%;
  margin-top: 20px;
  font-size: 1rem;
  padding: 14px;
}
.btn-primary:hover:not(:disabled) { background: var(--red-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--red); color: var(--red); }

/* ─── PROGRESS ───────────────────────────────────────────────────────────── */
.progress-wrap {
  margin-top: 20px;
  display: none;
}
.progress-wrap.show { display: block; }
.progress-label {
  font-size: 0.85rem;
  color: var(--mid);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.progress-bar-bg {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--red);
  border-radius: 99px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ─── RESULT CARD ────────────────────────────────────────────────────────── */
.result-card {
  background: var(--white);
  border: 1px solid #D1FAE5;
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-top: 20px;
  display: none;
}
.result-card.show { display: block; }
.result-icon { font-size: 2.5rem; margin-bottom: 10px; }
.result-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.result-card p { font-size: 0.88rem; color: var(--mid); margin-bottom: 20px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-download {
  background: var(--success);
  color: var(--white);
  padding: 11px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
}
.btn-download:hover { background: #16A34A; }

/* ─── ERROR ──────────────────────────────────────────────────────────────── */
.error-box {
  background: #FFF5F5;
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.88rem;
  color: #DC2626;
  margin-top: 16px;
  display: none;
}
.error-box.show { display: block; }

/* ─── TOOLS GRID (homepage) ──────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 32px;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  text-decoration: none;
  color: var(--dark);
  transition: all 0.18s;
  cursor: pointer;
}
.tool-card:hover {
  border-color: var(--red);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.tool-card .icon { font-size: 2rem; margin-bottom: 10px; }
.tool-card h3 { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; }
.tool-card p { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 32px 16px;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer a { color: var(--red); text-decoration: none; }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .tool-hero h1 { font-size: 1.4rem; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .option-row { flex-direction: column; align-items: flex-start; }
  .option-row label { min-width: unset; }
  .option-row select, .option-row input { width: 100%; }
}
