/* ==========================================================================
   PVC Card Tools — Unified Premium Stylesheet
   Used by: Aadhaar to PVC, Voter ID to PVC, e-PAN to PVC, Ration Card to PVC
   Theme: Royal Blue (#1a3566), Amber Gold (#d97706), Slate, Glassmorphism
   Supported Breakpoints: 320px, 375px, 430px, 768px, 1024px, 1280px+
   ========================================================================== */

/* --- Tool Header & Badges --- */
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(26, 53, 102, 0.12);
  box-shadow: 0 4px 16px rgba(26, 53, 102, 0.05);
  font-size: 13px;
  font-weight: 600;
  color: var(--royal-dark, #122549);
  margin-bottom: 18px;
  max-width: 100%;
  text-align: center;
}

.tool-badge i {
  font-size: 15px;
  color: #059669;
  flex-shrink: 0;
}

/* --- Dropzone Base & Responsive Ergonomics --- */
.dropzone {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px dashed rgba(26, 53, 102, 0.22);
  border-radius: 24px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.dropzone:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--royal, #1a3566);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(26, 53, 102, 0.08);
}

.dropzone.dragover,
.dropzone.drag-active {
  background: rgba(238, 246, 255, 0.95);
  border-color: #2563eb;
  border-style: solid;
  transform: scale(1.01);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.15), 0 20px 40px rgba(37, 99, 235, 0.12);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.dz-content {
  position: relative;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dz-icon-wrapper {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 12px 24px rgba(26, 53, 102, 0.22);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.dropzone:hover .dz-icon-wrapper {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
}

.dz-icon-wrapper svg {
  width: 38px;
  height: 38px;
}

.dropzone h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.dropzone p {
  font-size: 15px;
  color: var(--slate-600, #475569);
  margin-bottom: 18px;
  line-height: 1.5;
  max-width: 480px;
}

.dz-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  max-width: 100%;
}

.dz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(26, 53, 102, 0.06);
  border: 1px solid rgba(26, 53, 102, 0.1);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--royal, #1a3566);
  white-space: nowrap;
}

.dz-chip i {
  font-size: 12px;
  flex-shrink: 0;
}

.dz-btn {
  pointer-events: auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(26, 53, 102, 0.22);
}

/* --- Processing Panel & File Info --- */
.process-panel {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.file-info {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(248, 250, 252, 0.95);
  border: 1.5px solid #e2e8f0;
  padding: 16px 20px;
  border-radius: 18px;
  margin-bottom: 20px;
}

.file-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(26, 53, 102, 0.1), rgba(37, 99, 235, 0.15));
  color: var(--royal, #1a3566);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.file-icon-box svg {
  width: 24px;
  height: 24px;
}

.file-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.file-details h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  margin: 0 0 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.file-details p {
  font-size: 13px;
  color: var(--slate-500, #64748b);
  margin: 0;
  font-weight: 500;
}

.text-danger {
  color: #ef4444 !important;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  transform: scale(1.05);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* --- Bulk Files List Styles --- */
.bulk-files-wrapper {
  background: rgba(248, 250, 252, 0.95);
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.bulk-files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.bulk-files-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-count-badge {
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
}

.bulk-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-bulk-action {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-700, #334155);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-bulk-action:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-bulk-action.text-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.bulk-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 14px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 6px 4px 2px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.bulk-files-grid::-webkit-scrollbar {
  width: 6px;
}

.bulk-files-grid::-webkit-scrollbar-track {
  background: transparent;
}

.bulk-files-grid::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 9999px;
}

.bulk-files-grid::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

.bulk-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.bulk-file-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.bulk-file-item.is-ready:hover {
  border-color: #93c5fd;
  background: #fbfdff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
}

.bulk-file-item.active-preview {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.bulk-file-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.18));
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.12);
}

.bulk-file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bulk-file-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.bulk-file-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--slate-500, #64748b);
  line-height: 1;
}

.bulk-file-size {
  font-weight: 600;
  color: #64748b;
}

.bulk-file-dot {
  color: #cbd5e1;
  font-size: 8px;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.status-pill.ready {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-pill.locked {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  cursor: pointer;
}

.status-pill.locked:hover {
  background: #fde68a;
}

.status-pill.error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.bulk-file-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-item-adjust,
.btn-item-preview {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-item-adjust:hover,
.btn-item-preview:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.btn-item-adjust:active,
.btn-item-preview:active {
  transform: translateY(0);
}

.btn-item-adjust i,
.btn-item-preview i {
  font-size: 11px;
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--slate-400, #94a3b8);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-remove-item:hover {
  color: #ef4444;
  background: #fee2e2;
}

.preview-note-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: #1e40af;
  font-weight: 500;
}

.progress-container {
  margin-top: 16px;
  margin-bottom: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.progress-text-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a3566 0%, #2563eb 50%, #3b82f6 100%);
  background-size: 200% 100%;
  border-radius: 9999px;
  width: 0%;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
  animation: progressPulse 1.8s ease-in-out infinite;
}

@keyframes progressPulse {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* --- Interactive Cropping Workspace --- */
.crop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.crop-toolbar p {
  margin: 0;
  font-size: 13.5px;
  color: var(--slate-600, #475569);
  font-weight: 500;
  flex: 1;
  min-width: 260px;
}

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

.btn-calibrator-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: 1.5px solid #93c5fd;
  background: #eff6ff;
  color: #1e40af;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.btn-calibrator-toggle:hover {
  background: #dbeafe;
  border-color: #60a5fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.btn-calibrator-toggle:active {
  transform: translateY(0);
}

.bbc-panel {
  z-index: 100010 !important;
}

.btn-reset-crop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--royal, #1a3566);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-reset-crop:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.btn-reset-crop:active {
  transform: translateY(0);
}

.btn-calibrator-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #2563eb;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-calibrator-toggle:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}

.btn-calibrator-toggle:active {
  transform: translateY(0);
}

.crop-workspace {
  position: relative;
  width: 100%;
  overflow: auto;
  background: #e2e8f0;
  border-radius: 20px;
  margin-top: 16px;
  margin-bottom: 24px;
  padding: 30px 20px;
  display: block;
  text-align: center;
  min-height: 420px;
  box-sizing: border-box;
}

.crop-container {
  display: inline-block;
  text-align: left;
  position: relative;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  background: #ffffff;
  flex-shrink: 0;
}

#pdfCanvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.crop-box {
  position: absolute;
  border: 2.5px dashed #0284c7;
  background: rgba(2, 132, 199, 0.12);
  box-sizing: border-box;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  cursor: move;
  z-index: 10;
}

.crop-box::before {
  content: attr(data-label);
  position: absolute;
  top: -26px;
  left: 0;
  background: linear-gradient(135deg, #1a3566, #2563eb);
  color: #ffffff;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 15;
}

.resize-handle.tl { top: -6px; left: -6px; cursor: nwse-resize; }
.resize-handle.tr { top: -6px; right: -6px; cursor: nesw-resize; }
.resize-handle.bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.resize-handle.br { bottom: -6px; right: -6px; cursor: nwse-resize; }
.resize-handle.t { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.resize-handle.b { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.resize-handle.l { top: 50%; left: -6px; transform: translateY(-50%); cursor: ew-resize; }
/* --- PVC Output Customization Panel (DPI, Format, Corner Style, Card Style) --- */
.pvc-options-panel {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px 20px;
  margin-top: 20px;
  margin-bottom: 6px;
  box-shadow: 0 4px 18px rgba(26, 53, 102, 0.05);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: stretch;
  box-sizing: border-box;
}

/* 4-Option Layout (Aadhaar): Perfectly balanced 2x2 grid on desktop */
.pvc-options-panel.pvc-options-grid-4 {
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
}

.pvc-option-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.pvc-option-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pvc-option-label i {
  color: #2563eb;
  font-size: 13px;
}

.pvc-pill-selector {
  display: flex;
  align-items: stretch;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 11px;
  border: 1.5px solid #e2e8f0;
  gap: 4px;
  box-sizing: border-box;
  width: 100%;
}

.pvc-pill-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  gap: 5px;
  padding: 6px 6px;
  min-height: 38px;
  height: 38px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
  box-sizing: border-box;
  position: relative;
}

.pvc-pill-btn i {
  font-size: 12px;
  flex-shrink: 0;
  line-height: 1;
}

.pvc-pill-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.9);
  color: #1e293b;
}

.pvc-pill-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.pvc-pill-btn.active {
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
}

.pvc-pill-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.08);
  color: #64748b;
  letter-spacing: 0.02em;
  transition: all 0.18s ease;
  flex-shrink: 0;
  line-height: 1.1;
}

.pvc-pill-btn.active .pvc-pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

@media (max-width: 860px) {
  .pvc-options-panel {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }

  .pvc-options-panel.pvc-options-grid-4 {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }

  .pvc-pill-btn {
    min-height: 40px;
    height: 40px;
    font-size: 12.5px;
    padding: 7px 10px;
    gap: 6px;
  }

  .pvc-pill-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* --- Action Row Buttons --- */
.action-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
  margin-top: 22px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.action-row .btn {
  flex: 1 1 0 !important;
  width: auto !important;
  min-height: 48px !important;
  height: 48px !important;
  max-height: 48px !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 0 20px !important;
  text-align: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  border: none !important;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.action-row .btn i {
  font-size: 14px;
}

.l2-btn-primary {
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25) !important;
}

.l2-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #162b55 0%, #1d4ed8 100%) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35) !important;
}

.l2-btn-gold {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.25) !important;
}

.l2-btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.35) !important;
}

.action-row .btn:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

@media (max-width: 640px) {
  .action-row {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .action-row .btn {
    width: 100% !important;
    flex: none !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    font-size: 14px !important;
    padding: 0 16px !important;
  }
}

/* --- Header Stacking & Dynamic Spacing Variables --- */
:root {
  --scc-header-offset: 72px;
}

body:has(#scc-usage-banner) {
  --scc-header-offset: 114px;
}

#tools-header-placeholder {
  position: sticky;
  top: 0;
  z-index: 100002 !important;
  width: 100%;
}

/* --- Body Lock When Modal Open --- */
body.modal-open {
  overflow: hidden !important;
}

/* --- Password & Preview Modals --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  animation: fadeIn 0.2s ease;
  box-sizing: border-box;
}

#previewModal {
  padding-top: calc(var(--scc-header-offset, 72px) + 20px) !important;
  padding-bottom: 24px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.modal.hidden,
.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  z-index: 100001;
  background: #ffffff;
  border-radius: 24px;
  padding: 28px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body p {
  font-size: 14px;
  color: var(--slate-600, #475569);
  line-height: 1.5;
  margin-bottom: 14px;
}

.modal-body .form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.modal-body .form-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-footer .btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
}

/* --- Section Headlines & Subtitles --- */
.section-headline {
  font-size: 26px;
  font-weight: 900;
  color: var(--royal-dark, #122549);
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 15px;
  color: var(--slate-600, #475569);
  text-align: center;
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* --- Info Grid & Card Containers --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.info-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 28px 24px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.info-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(26, 53, 102, 0.1), rgba(37, 99, 235, 0.15));
  color: var(--royal, #1a3566);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.info-card-icon.gold {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(245, 158, 11, 0.2));
  color: #d97706;
}

.info-card-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin: 0;
}

/* --- Step Items List --- */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a3566, #2563eb);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(26, 53, 102, 0.22);
}

.step-text {
  flex: 1;
}

.step-text h5 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
  margin: 0 0 3px 0;
}

.step-text p {
  font-size: 13.5px;
  color: var(--slate-600, #475569);
  line-height: 1.5;
  margin: 0;
}

/* --- Guidelines List --- */
.guidelines-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guideline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.85);
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.guideline-icon {
  font-size: 18px;
  color: #d97706;
  flex-shrink: 0;
  margin-top: 2px;
}

.guideline-text {
  font-size: 13.5px;
  color: var(--slate-700, #334155);
  line-height: 1.5;
  flex: 1;
}

.guideline-text strong {
  color: var(--slate-900, #0f172a);
}

/* --- SEO Article Block --- */
.article-block {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 60px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.03);
}

.article-block h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-top: 0;
  margin-bottom: 14px;
}

.article-block h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-top: 24px;
  margin-bottom: 10px;
}

.article-block p {
  font-size: 14.5px;
  color: var(--slate-600, #475569);
  line-height: 1.7;
  margin-bottom: 14px;
}

.article-highlight-box {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  padding: 16px 20px;
  border-radius: 12px;
  margin: 20px 0;
}

.article-highlight-box h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 800;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-highlight-box p {
  margin: 0;
  font-size: 13.5px;
  color: #1e40af;
  line-height: 1.6;
}

/* --- FAQ Section & Accordion --- */
.faq-section {
  margin-bottom: 60px;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}

.accordion-item {
  background: #ffffff;
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.accordion-item:hover {
  border-color: #bfdbfe;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.06);
}

.accordion-header {
  width: 100%;
  padding: 18px 22px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: color 0.2s ease;
}

.accordion-header:hover {
  color: #2563eb;
}

.accordion-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, color 0.2s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
  background: #2563eb;
  color: #ffffff;
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-body p {
  padding: 0 22px 20px 22px;
  margin: 0;
  font-size: 14px;
  color: var(--slate-600, #475569);
  line-height: 1.6;
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints (Mobile, Tablet, Desktop)
   ========================================================================== */

/* --- Tablet & Mobile (max-width: 768px) --- */
@media (max-width: 768px) {
  .btn-item-adjust,
  .btn-item-preview,
  #openGlobalPreviewBtn,
  #previewModal {
    display: none !important;
  }

  .action-row {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .action-row .btn {
    width: 100% !important;
    flex: none !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
  }
}

/* --- Mobile Devices (max-width: 480px) --- */
@media (max-width: 480px) {
  .tool-badge {
    font-size: 11px;
    padding: 5px 12px;
    gap: 6px;
    margin-bottom: 12px;
  }

  .dropzone {
    padding: 24px 14px 20px;
    border-radius: 16px;
  }

  .dz-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    margin-bottom: 12px;
  }

  .dz-icon-wrapper svg {
    width: 28px;
    height: 28px;
  }

  .dropzone h3 {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .dropzone p {
    font-size: 12.5px;
    margin-bottom: 12px;
  }

  .dz-chips {
    gap: 6px;
    margin-bottom: 14px;
  }

  .dz-chip {
    font-size: 10.5px;
    padding: 3px 8px;
    gap: 4px;
  }

  .dz-btn {
    width: 100%;
    max-width: 260px;
    font-size: 14px;
    padding: 11px 18px;
    border-radius: 12px;
  }

  .file-info {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .file-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .crop-workspace {
    padding: 16px 10px;
    min-height: 300px;
    border-radius: 16px;
  }

  .action-row .btn {
    font-size: 14px;
    padding: 12px 18px;
    border-radius: 12px;
    min-height: 44px;
  }

  .info-card {
    padding: 20px 16px;
  }

  .article-block {
    padding: 20px 16px;
  }

  .accordion-header {
    padding: 14px 16px;
    font-size: 14px;
  }

  .accordion-body p {
    padding: 0 16px 16px 16px;
    font-size: 13px;
  }
}


/* --- Optional Preview & Adjust Modal --- */
.preview-modal-content {
  position: relative;
  z-index: 100001;
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  max-width: 1260px;
  width: 95%;
  max-height: calc(100vh - var(--scc-header-offset, 72px) - 44px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(226, 232, 240, 0.9);
  overflow: hidden;
  box-sizing: border-box;
}

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 12px;
  flex-shrink: 0;
  gap: 12px;
}

.preview-modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-modal-title-wrap h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#previewModalDocName {
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-modal-title-wrap p {
  font-size: 12.5px;
  color: var(--slate-500, #64748b);
  margin: 0;
}

/* Modal File Navigation (Header Pill) */
.modal-file-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 9999px;
  padding: 3px 8px;
}

.btn-file-nav {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.2s ease;
}

.btn-file-nav:hover:not(:disabled) {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: scale(1.06);
}

.btn-file-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.file-nav-counter {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e3a8a;
  padding: 0 6px;
  white-space: nowrap;
}

.preview-modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--slate-600, #475569);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.preview-modal-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: rotate(90deg);
}

.preview-modal-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 8px;
}

.preview-instruction-bar {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-instruction-bar i {
  color: #2563eb;
  font-size: 14px;
  flex-shrink: 0;
}

.preview-modal-body .crop-workspace {
  margin-top: 8px;
  margin-bottom: 8px;
}

.preview-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-footer-nav:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.btn-footer-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-preview-done {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-preview-done:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
