/* ============================================================
   ⚡ QuickConverter — Signature PDF Tool (UX Psychology Enhanced)
   ------------------------------------------------------------
   Colors:
     • Blue  = Trust / Professional
     • Green = Success / Completion
     • Orange = Action / Motivation
     • Gold  = Premium / Reward
   ============================================================ */

body {
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #eef6ff, #ffffff);
  color: #1e293b;
  margin: 0;
  padding: 0;
  transition: background 0.4s, color 0.4s;
}
/* sign-pdf.css — matches layout & style of Compress PDF */

.tool-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 50px 0;
}

.tool-box {
  width: 600px;
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

body.dark-mode .tool-box {
  background: #1e293b;
  box-shadow: 0 6px 20px rgba(255,255,255,0.05);
}

.drop-zone {
  margin: 15px 0;
}

.btn-primary {
  background: #0078d7;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

.btn-primary:hover {
  background: #005fa3;
}

.dark-mode {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e2e8f0;
}

/* ========================= Header ========================= */
header.glass-header {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 30px;
  position: sticky;
  top: 0;
  z-index: 100;
}

header.glass-header .logo span {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0078d7;
  letter-spacing: 0.5px;
}

.dark-mode header.glass-header {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ========================= Hero Section ========================= */
.hero {
  text-align: center;
  padding: 70px 20px 30px;
  color: #ffffff;
  border-radius: 0 0 40px 40px;
  box-shadow: 0 8px 20px rgba(0, 120, 215, 0.3);
  background: linear-gradient(135deg, #0078d7, #00b4d8);
}

/* Optional specialized hero variants for reuse across tools */
.hero-split {
  background: linear-gradient(135deg, #0078d7, #00b4d8);
}

.hero-merge {
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
}

.hero-reduce {
  background: linear-gradient(135deg, #ff7e29, #ff9f43);
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.hero p {
  color: #e0f7ff;
  font-size: 1.1rem;
}

/* ========================= Tool Container ========================= */
.tool-container {
  max-width: 720px;
  margin: 40px auto;
  background: #ffffff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: all 0.4s;
}

.tool-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.dark-mode .tool-container {
  background: #1e293b;
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.05);
}

/* ========================= Drop Zone ========================= */
.drop-zone {
  border: 3px dashed #0078d7;
  border-radius: 12px;
  padding: 50px;
  color: #475569;
  background: #f9fbfd;
  cursor: pointer;
  transition: all 0.3s ease;
}

.drop-zone:hover {
  background: #eaf5ff;
}

.drop-zone.dragging {
  background: #dbeafe;
  border-color: #0284c7;
  transform: scale(1.02);
}

/* ========================= File List ========================= */
.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 6px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.file-item .remove-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.2em;
  transition: transform 0.2s;
}

.file-item .remove-btn:hover {
  transform: scale(1.2);
}

/* ========================= Primary Button ========================= */
.btn-primary {
  background: linear-gradient(90deg, #0078d7, #00a6ff);
  color: #fff;
  border: none;
  padding: 13px 28px;
  border-radius: 8px;
  font-size: 1.05rem;
  cursor: pointer;
  margin-top: 20px;
  box-shadow: 0 4px 10px rgba(0, 120, 215, 0.25);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(90deg, #005fa3, #0084d1);
  transform: translateY(-2px);
}

/* ========================= Clear Button ========================= */
.btn-secondary {
  background: linear-gradient(90deg, #ff7e29, #ff9f43);
  color: #fff;
  font-weight: 600;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  cursor: pointer;
  margin: 20px 10px 0;
  box-shadow: 0 4px 12px rgba(255, 126, 41, 0.35);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: linear-gradient(90deg, #ff5e00, #ff7e29);
  box-shadow: 0 6px 18px rgba(255, 94, 0, 0.4);
  transform: translateY(-2px);
}

/* ========================= Login Button ========================= */
.login-action {
  background: linear-gradient(90deg, #facc15, #fbbf24);
  color: #000;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 8px;
  display: inline-block;
  margin: 20px 10px 0;
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.4);
  transition: all 0.3s ease;
}

.login-action:hover {
  background: linear-gradient(90deg, #eab308, #facc15);
  transform: translateY(-2px);
}

/* ========================= Login Prompt ========================= */
#loginPrompt {
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
  border-left: 5px solid #0078d7;
  border-radius: 12px;
  padding: 25px;
  margin-top: 40px;
  text-align: center;
  font-size: 1rem;
  box-shadow: 0 6px 14px rgba(0, 120, 215, 0.1);
  color: #334155;
  line-height: 1.6;
}

.dark-mode #loginPrompt {
  background: linear-gradient(135deg, #1e3a8a, #172554);
  border-left-color: #38bdf8;
  color: #e2e8f0;
}

#loginPrompt .actions {
  margin-top: 15px;
}

/* ========================= Progress Bar ========================= */
#progressContainer {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 6px;
  margin-top: 20px;
  overflow: hidden;
  display: none;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0078d7, #22c55e);
  transition: width 0.3s ease-in-out;
}

#progressText {
  font-size: 0.95rem;
  margin-top: 10px;
  color: #475569;
}

/* ========================= Result Section ========================= */
#resultSection {
  display: none;
  margin-top: 25px;
}

#downloadLink {
  display: inline-block;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: #fff;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
  transition: all 0.3s;
}

#downloadLink:hover {
  background: linear-gradient(90deg, #16a34a, #15803d);
  transform: translateY(-2px);
}

/* ========================= Related Tools ========================= */
.related-tools {
  max-width: 900px;
  margin: 60px auto;
  text-align: center;
  background: linear-gradient(135deg, #f9fafb, #f0f9ff);
  border-radius: 14px;
  padding: 40px 30px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.related-tools h3 {
  font-size: 1.5rem;
  color: #0f172a;
  margin-bottom: 20px;
}

.related-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.related-grid a {
  background: linear-gradient(90deg, #0078d7, #00a2ff);
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 3px 10px rgba(0, 120, 215, 0.25);
}

.related-grid a:hover {
  background: linear-gradient(90deg, #005fa3, #0078d7);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 95, 163, 0.35);
}

/* ========================= Footer ========================= */
footer {
  text-align: center;
  padding: 35px 10px;
  margin-top: 60px;
  color: #64748b;
  font-size: 1rem;
  border-top: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f9fafb, #f1f5f9);
}

footer strong {
  color: #0078d7;
  font-weight: 700;
}

footer:hover strong {
  color: #0284c7;
}

/* ========================= Fade Animations ========================= */
.fade-in {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================= Responsive ========================= */
@media (max-width: 650px) {
  .tool-container {
    padding: 25px;
  }

  .btn-primary,
  .btn-secondary,
  .login-action {
    width: 100%;
    margin-left: 0;
  }

  .hero h1 {
    font-size: 1.8rem;
  }
}

/* ========================= Usage Counter ========================= */
#usage-container {
  display: inline-flex;
  align-items: center;
  background-color: #fff3e0;
  border: 1px solid #ffe0b2;
  padding: 8px 16px;
  border-radius: 50px;
  margin: 10px 0;
  font-size: 14px;
  color: #e65100;
  transition: all 0.3s ease;
}

#usage-container.hidden {
  display: none;
}

#usage-count {
  margin-left: 5px;
  font-size: 16px;
}

/* Red alert when only 1 or 0 remain */
.usage-low {
  background-color: #ffebee !important;
  color: #c62828 !important;
  border-color: #ffcdd2 !important;
}
/* ============================================================
   🖋️ QuickConverter — Signature Specific Enhancements (Additive)
   ============================================================ */

/* Signature Control Card Layout */
.sign-options-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px;
    text-align: left;
}

.sign-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.3s;
}

.dark-mode .sign-card {
    background: #1e293b;
    border-color: #334155;
}

/* ✍️ Signature Type Tabs */
.signature-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

.dark-mode .signature-type-tabs {
    border-bottom-color: #334155;
}

.tab-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.dark-mode .tab-btn {
    background: #334155;
    color: #cbd5e1;
}

.tab-btn.active {
    background: #0078d7;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 120, 215, 0.3);
}

/* 🧩 Plan-aware Permissions (Pro Locks) */
.tab-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
}

.dark-mode .tab-btn.disabled {
    background: #1e293b;
    border-color: #475569;
}

.pro-lock-icon {
    font-size: 12px;
    background: #fbbf24;
    color: #78350f;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
}

/* 🎨 Canvas / Drawing Pad */
#sig-canvas {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    cursor: crosshair;
    background: #ffffff;
    width: 100%;
    height: 180px;
    touch-action: none; /* Prevents scrolling while signing on mobile */
}

.dark-mode #sig-canvas {
    background: #f8fafc; /* Keep canvas light for contrast */
    border-color: #475569;
}

/* 🪶 Auto-centering & Multi-page Panels */
.settings-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 10px;
}

.dark-mode .settings-panel {
    background: #0f172a;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setting-item label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #0369a1;
    background: #e0f2fe;
    padding: 4px 10px;
    border-radius: 99px;
    font-weight: 600;
}

.dark-mode .feature-tag {
    background: #1e3a8a;
    color: #7dd3fc;
}

/* 🧾 Multi-page Select Styling */
select#pageSelection {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-family: inherit;
    color: #1e293b;
    cursor: pointer;
}

.dark-mode select#pageSelection {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

/* Typed Input Area */
#signatureText {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 1.2rem;
    font-family: "Inter", sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

#signatureText:focus {
    border-color: #0078d7;
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.1);
}

.dark-mode #signatureText {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

/* Mobile Adjustments for Signature Pad */
@media (max-width: 600px) {
    .settings-panel {
        grid-template-columns: 1fr;
    }
    
    .signature-type-tabs {
        flex-direction: column;
    }
}
/* 🖊️ Professional Signature Pad Styling */

#drawInputArea {
  margin-top: 15px;
  animation: fadeIn 0.3s ease-in-out;
}

/* The Canvas Container */
#sig-canvas {
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background-color: #ffffff;
  background-image:
    linear-gradient(to right, #f1f5f9 1px, transparent 1px),
    linear-gradient(to bottom, #f1f5f9 1px, transparent 1px);
  background-size: 20px 20px; /* Subtle grid for better writing alignment */
  cursor: url('https://cdn-icons-png.flaticon.com/32/1066/1066347.png'), crosshair; /* Pen icon cursor */
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
  touch-action: none; /* Prevents scrolling while signing on mobile */
}

#sig-canvas:active {
  border-color: #0078d7;
  box-shadow: 0 0 0 4px rgba(0, 120, 215, 0.1);
}

/* Clear Button Styling */
.btn-outline-danger {
  color: #dc2626;
  border: 1px solid #fecaca;
  background: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline-danger:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* Animation for smooth appearance */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
