/* =============================================
   PDFScanner.io — Shared Styles
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

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

:root {
  --red: #FF0000;
  --red-dark: #CC0000;
  --red-deeper: #a00000;
  --red-light: #fff5f5;
  --red-mid: #ffe0e0;
  --text: #111827;
  --text-2: #374151;
  --text-3: #6B7280;
  --border: #E5E7EB;
  --border-2: #D1D5DB;
  --white: #ffffff;
  --bg: #F9FAFB;
  --bg-2: #F3F4F6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-red: 0 4px 20px rgba(255,0,0,0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.25; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ---- NAV ---- */
.site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 64px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem; font-weight: 800; color: var(--red);
  flex-shrink: 0;
}
.nav-logo-box {
  width: 38px; height: 38px; background: var(--red); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.05rem; font-weight: 900;
  box-shadow: 0 2px 8px rgba(255,0,0,0.3);
}
.nav-logo-text { color: var(--text); font-weight: 400; font-size: 1rem; margin-left: -2px; }
.nav-links {
  display: flex; align-items: center; gap: 2px;
  list-style: none;
}
.nav-links a {
  padding: 7px 13px; border-radius: 7px;
  font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { background: var(--red-light); color: var(--red); }
.nav-links a.active { color: var(--red); background: var(--red-light); }
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px;
}
.hamburger span {
  width: 22px; height: 2px; background: var(--text);
  border-radius: 2px; transition: 0.25s;
}

/* ---- FOOTER ---- */
.site-footer {
  background: #111827; color: #9CA3AF;
  padding: 56px 28px 28px;
}
.footer-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr;
  gap: 48px; padding-bottom: 48px;
  border-bottom: 1px solid #1F2937;
}
.footer-brand-desc {
  font-size: 0.875rem; line-height: 1.7; margin-top: 14px; color: #6B7280;
}
.footer-col h5 {
  color: var(--white); font-size: 0.875rem; font-weight: 700;
  margin-bottom: 16px; font-family: 'Plus Jakarta Sans', sans-serif;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a {
  font-size: 0.845rem; color: #6B7280;
  transition: color 0.15s;
}
.footer-col ul li a:hover { color: var(--red); }
.footer-bottom {
  max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; padding-top: 24px;
}
.footer-bottom p { font-size: 0.8rem; }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { font-size: 0.8rem; color: #6B7280; transition: color 0.15s; }
.footer-bottom-links a:hover { color: var(--red); }

/* ---- TOOL PAGE SHARED ---- */
.tool-hero {
  background: linear-gradient(135deg, #fff 0%, var(--red-light) 100%);
  border-bottom: 1px solid var(--border);
  padding: 52px 28px 44px;
  text-align: center;
}
.tool-hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--red-light); border: 1px solid var(--red-mid);
  color: var(--red); border-radius: 20px; padding: 5px 14px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; margin-bottom: 18px;
}
.tool-hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 800;
  color: var(--text); max-width: 700px; margin: 0 auto 14px;
}
.tool-hero p {
  font-size: 1.05rem; color: var(--text-3);
  max-width: 560px; margin: 0 auto;
  line-height: 1.65;
}

/* ---- UPLOAD ZONE ---- */
.upload-section {
  max-width: 800px; margin: 0 auto; padding: 40px 24px 0;
}
.drop-zone {
  border: 2.5px dashed var(--border-2);
  border-radius: var(--radius-xl);
  padding: 52px 28px;
  text-align: center;
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  position: relative;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--red);
  background: var(--red-light);
  transform: translateY(-2px);
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.drop-icon {
  width: 64px; height: 64px; background: var(--red-light);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; font-size: 1.8rem;
}
.drop-zone h3 {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 7px; color: var(--text);
}
.drop-zone p { font-size: 0.875rem; color: var(--text-3); }
.drop-zone .or-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 18px 0; color: var(--text-3); font-size: 0.82rem;
}
.drop-zone .or-divider::before,
.drop-zone .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-upload-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red); color: white;
  border-radius: 9px; padding: 12px 28px;
  font-size: 0.95rem; font-weight: 700;
  box-shadow: var(--shadow-red);
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  pointer-events: none;
}
.drop-zone:hover .btn-upload-trigger { background: var(--red-dark); }

/* ---- FILE LIST ---- */
.file-list {
  max-width: 800px; margin: 20px auto 0; padding: 0 24px;
  display: none;
}
.file-list.visible { display: block; }
.file-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.file-item-icon { font-size: 1.4rem; flex-shrink: 0; }
.file-item-info { flex: 1; min-width: 0; }
.file-item-name { font-size: 0.875rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item-size { font-size: 0.78rem; color: var(--text-3); margin-top: 2px; }
.file-item-remove {
  width: 28px; height: 28px; border-radius: 6px; background: #FEE2E2;
  color: var(--red); font-size: 0.9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s; flex-shrink: 0;
}
.file-item-remove:hover { background: var(--red-mid); }

/* ---- OPTIONS PANEL ---- */
.options-panel {
  max-width: 800px; margin: 20px auto 0; padding: 0 24px;
  display: none;
}
.options-panel.visible { display: block; }
.options-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.options-card h4 {
  font-size: 0.9rem; font-weight: 700; margin-bottom: 16px;
  color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 12px;
}
.option-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.option-row label { font-size: 0.855rem; font-weight: 600; color: var(--text-2); min-width: 120px; }
.option-row input[type="text"],
.option-row input[type="number"],
.option-row input[type="password"],
.option-row select {
  padding: 8px 12px; border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm); font-size: 0.875rem;
  font-family: inherit; color: var(--text); background: var(--bg);
  transition: border-color 0.15s;
}
.option-row input:focus, .option-row select:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255,0,0,0.08);
}
.option-row input[type="range"] { accent-color: var(--red); }
.option-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-btn {
  padding: 7px 16px; border-radius: 7px; font-size: 0.82rem; font-weight: 600;
  border: 1.5px solid var(--border-2); color: var(--text-2); background: var(--white);
  cursor: pointer; transition: all 0.15s;
}
.opt-btn:hover, .opt-btn.active {
  border-color: var(--red); color: var(--red); background: var(--red-light);
}

/* ---- PROCESS BUTTON ---- */
.process-wrap {
  max-width: 800px; margin: 24px auto 0; padding: 0 24px;
  text-align: center; display: none;
}
.process-wrap.visible { display: block; }
.btn-process {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--red); color: white;
  border-radius: var(--radius); padding: 15px 40px;
  font-size: 1.05rem; font-weight: 700;
  box-shadow: var(--shadow-red);
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  cursor: pointer; border: none;
}
.btn-process:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255,0,0,0.25); }
.btn-process:active { transform: translateY(0); }
.btn-process:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; transform: none; }

/* ---- PROGRESS ---- */
.progress-wrap {
  max-width: 800px; margin: 20px auto 0; padding: 0 24px;
  display: none;
}
.progress-wrap.visible { display: block; }
.progress-bar-outer {
  background: var(--bg-2); border-radius: 999px; height: 10px; overflow: hidden; margin-bottom: 8px;
}
.progress-bar-inner {
  height: 100%; background: var(--red); border-radius: 999px;
  transition: width 0.3s ease; width: 0%;
}
.progress-label { font-size: 0.82rem; color: var(--text-3); text-align: center; }

/* ---- RESULT ---- */
.result-wrap {
  max-width: 800px; margin: 24px auto 40px; padding: 0 24px;
  display: none;
}
.result-wrap.visible { display: block; }
.result-card {
  background: #F0FDF4; border: 1.5px solid #86EFAC;
  border-radius: var(--radius-lg); padding: 28px;
  text-align: center;
}
.result-card .result-icon { font-size: 2.5rem; margin-bottom: 12px; }
.result-card h3 { font-size: 1.1rem; font-weight: 700; color: #166534; margin-bottom: 6px; }
.result-card p { font-size: 0.875rem; color: #15803D; margin-bottom: 20px; }
.btn-download {
  display: inline-flex; align-items: center; gap: 9px;
  background: #16A34A; color: white;
  border-radius: var(--radius); padding: 13px 32px;
  font-size: 0.95rem; font-weight: 700;
  transition: background 0.15s, transform 0.12s;
  cursor: pointer; border: none;
}
.btn-download:hover { background: #15803D; transform: translateY(-2px); }
.btn-reset {
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: 12px;
  background: var(--white); color: var(--text-2); border: 1.5px solid var(--border-2);
  border-radius: var(--radius); padding: 12px 24px;
  font-size: 0.875rem; font-weight: 600;
  transition: all 0.15s; cursor: pointer;
}
.btn-reset:hover { border-color: var(--red); color: var(--red); }

/* OCR specific result */
.ocr-result-text {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-top: 16px;
  text-align: left; font-size: 0.875rem; color: var(--text);
  max-height: 400px; overflow-y: auto; white-space: pre-wrap;
  font-family: 'DM Sans', sans-serif; line-height: 1.7;
}

/* ---- ERROR ---- */
.error-wrap {
  max-width: 800px; margin: 16px auto 0; padding: 0 24px;
  display: none;
}
.error-wrap.visible { display: block; }
.error-card {
  background: #FEF2F2; border: 1.5px solid #FECACA;
  border-radius: var(--radius); padding: 16px 20px;
  font-size: 0.875rem; color: #991B1B;
  display: flex; align-items: center; gap: 10px;
}

/* ---- HOW IT WORKS ---- */
.how-section {
  max-width: 900px; margin: 0 auto; padding: 60px 28px;
  text-align: center;
}
.section-eyebrow {
  font-size: 0.75rem; font-weight: 700; color: var(--red);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.section-title {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem); font-weight: 800;
  color: var(--text); margin-bottom: 10px;
}
.section-sub { font-size: 0.95rem; color: var(--text-3); max-width: 480px; margin: 0 auto 40px; }
.steps-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.step-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.step-num {
  width: 44px; height: 44px; background: var(--red); color: white;
  border-radius: 50%; font-size: 1rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.step-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 7px; }
.step-card p { font-size: 0.82rem; color: var(--text-3); line-height: 1.5; }

/* ---- SEO CONTENT ---- */
.seo-section {
  max-width: 900px; margin: 0 auto; padding: 0 28px 60px;
}
.seo-section h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; margin-top: 36px; color: var(--text); }
.seo-section h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; margin-top: 24px; color: var(--text-2); }
.seo-section p { font-size: 0.9rem; color: var(--text-3); margin-bottom: 12px; line-height: 1.75; }
.seo-section ul { padding-left: 20px; margin-bottom: 12px; }
.seo-section ul li { font-size: 0.875rem; color: var(--text-3); margin-bottom: 6px; line-height: 1.6; }

/* ---- FAQ ---- */
.faq-section {
  max-width: 800px; margin: 0 auto; padding: 0 28px 60px;
}
.faq-item {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  padding: 16px 20px; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  color: var(--text);
  transition: background 0.15s;
}
.faq-q:hover { background: var(--red-light); }
.faq-chevron { color: var(--red); transition: transform 0.2s; font-size: 0.7rem; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a {
  padding: 0 20px; max-height: 0; overflow: hidden;
  font-size: 0.875rem; color: var(--text-3); line-height: 1.7;
  transition: max-height 0.3s ease, padding 0.2s;
}
.faq-item.open .faq-a { max-height: 300px; padding: 0 20px 16px; }

/* ---- TRUST BADGES ---- */
.trust-strip {
  background: var(--white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 20px 28px;
}
.trust-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
}
.trust-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-2);
}
.trust-badge-icon { color: var(--red); font-size: 1rem; }

/* ---- RELATED TOOLS ---- */
.related-section {
  max-width: 1100px; margin: 0 auto; padding: 0 28px 64px;
}
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-top: 24px;
}
.related-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 14px; text-align: center;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  display: block;
}
.related-card:hover {
  border-color: var(--red); transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255,0,0,0.1);
}
.related-card-icon { font-size: 1.4rem; margin-bottom: 8px; }
.related-card span { font-size: 0.8rem; font-weight: 700; color: var(--text-2); }

/* ---- CANVAS for sign/preview ---- */
.canvas-wrap {
  max-width: 800px; margin: 20px auto 0; padding: 0 24px; display: none;
}
.canvas-wrap.visible { display: block; }
#sign-canvas {
  border: 2px solid var(--border-2); border-radius: var(--radius);
  cursor: crosshair; width: 100%; display: block; background: white; touch-action: none;
}
.canvas-controls { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* ---- PAGE THUMBNAILS ---- */
.pages-preview {
  max-width: 800px; margin: 20px auto 0; padding: 0 24px; display: none;
}
.pages-preview.visible { display: block; }
.pages-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.page-thumb {
  border: 2px solid var(--border); border-radius: 8px;
  overflow: hidden; cursor: pointer; position: relative;
  transition: border-color 0.15s;
}
.page-thumb:hover { border-color: var(--red); }
.page-thumb.selected { border-color: var(--red); box-shadow: 0 0 0 2px rgba(255,0,0,0.2); }
.page-thumb canvas { width: 100%; display: block; }
.page-thumb-label {
  text-align: center; font-size: 0.7rem; color: var(--text-3);
  padding: 4px; background: var(--bg);
}
.page-thumb .page-check {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px; background: var(--red); border-radius: 50%;
  color: white; font-size: 0.6rem; font-weight: 700;
  display: none; align-items: center; justify-content: center;
}
.page-thumb.selected .page-check { display: flex; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .steps-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; position: fixed; top: 64px; left: 0; right: 0; background: var(--white); padding: 16px; border-bottom: 1px solid var(--border); z-index: 199; box-shadow: var(--shadow-lg); }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .result-card .btn-download, .result-card .btn-reset { width: 100%; justify-content: center; margin: 6px 0 0 0; }
  .trust-inner { gap: 18px; }
}
