/* Extract Specific Pages from PDF — matches the Deecliq Data Transfer shape exactly. */
.rmp-fit.rmp-scope {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 1600px; margin: 0 auto;
  padding: 90px 4vw 60px;
}

.rmp-hero { text-align: center; flex-shrink: 0; }
.rmp-hero h1 {
  font-size: 1.5rem !important; font-weight: 800 !important;
  color: var(--brand, #2563eb) !important;
  margin: 0 0 4px !important;
}
#rmpScope .rmp-hero p {
  font-size: .85rem !important; color: var(--txt-2, #64748b) !important;
  margin: 0 !important;
}

#rmpScope .rmp-card {
  max-width: 100% !important; width: 100%;
  padding: 24px 32px !important;
  background: var(--page-bg, #f8fafc) !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  box-shadow: none !important;
  margin: 0 auto !important;
}
.rmp-input-view { display: flex; flex-direction: column; }

.rmp-input-section { display: flex; min-height: 320px; }
.rmp-scope .rmp-dropzone {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  padding: 26px 20px;
  border: 2px dashed var(--brand, #2563eb);
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  color: var(--txt, #0f172a);
  background: transparent;
  transition: border-color .2s ease, background .2s ease;
}
.rmp-scope .rmp-dropzone:hover,
.rmp-scope .rmp-dropzone.rmp-dragover {
  border-color: var(--brand-dark, #1d4ed8);
  background: rgba(37,99,235,.05);
}
.rmp-scope .rmp-dropzone i {
  color: var(--brand, #2563eb);
  font-size: 2.2rem;
  display: inline-block;
  animation: rmpIconFloat 2.4s ease-in-out infinite;
}
@keyframes rmpIconFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .rmp-scope .rmp-dropzone i { animation: none; }
}
.rmp-drop-title { font-weight: 700; margin-top: 10px; font-size: .95rem; color: var(--txt, #0f172a); }
.rmp-drop-sub { font-size: .8rem; opacity: .65; margin-top: 4px; color: var(--txt-2, #64748b); }

.rmp-file-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
}
.rmp-file-row i.fa-file-pdf { font-size: 1.4rem; color: var(--brand, #2563eb); }
.rmp-file-name { font-weight: 700; font-size: .88rem; color: var(--txt, #0f172a); word-break: break-all; }
.rmp-file-size { font-size: .76rem; color: var(--txt-2, #64748b); }
.rmp-remove {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand, #2563eb); border: none; border-radius: 50%;
  color: #fff; font-size: .85rem; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.rmp-remove:hover { background: #dc2626; transform: scale(1.08); }

.rmp-shake { animation: rmpShake .4s ease; }
@keyframes rmpShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .rmp-shake { animation: none; }
}

.rmp-error {
  margin-top: 12px; padding: 10px 14px; border-radius: 10px;
  background: var(--page-bg, #f8fafc);
  border: 1px dashed var(--brand, #2563eb);
  color: var(--txt, #0f172a); font-size: .85rem;
}

.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }

#rmpScope #rmpUploadBtn,
#rmpScope #rmpSettingsConfirmBtn,
#rmpScope #rmpDownloadBtn {
  background: linear-gradient(135deg, var(--brand, #2563eb), var(--brand-dark, #1d4ed8));
  border: none;
  padding: 13px 26px;
  font-weight: 700;
  font-size: .95rem;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(37,99,235,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
#rmpScope #rmpUploadBtn:hover,
#rmpScope #rmpSettingsConfirmBtn:hover,
#rmpScope #rmpDownloadBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(37,99,235,.45);
}
#rmpScope #rmpUploadBtn:active,
#rmpScope #rmpSettingsConfirmBtn:active,
#rmpScope #rmpDownloadBtn:active { transform: translateY(0); }
#rmpScope .btn-warning { padding: 13px 26px; font-weight: 700; font-size: .95rem; border-radius: 12px; }

.rmp-hint { font-size: .76rem; color: var(--txt-2, #64748b); margin-top: 6px; }

/* ── Page grid + side panel (iLovePDF-style) ── */
.rmp-workspace {
  display: flex; align-items: stretch;
  min-height: 70vh;
  border: 1px solid var(--border, #e2e8f0); border-radius: 14px; overflow: hidden;
  background: var(--page-bg, #f8fafc);
}

.rmp-thumb-panel { flex: 1; min-width: 0; padding: 28px; overflow-y: auto; max-height: 80vh; }
.rmp-thumb-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 26px;
}

.rmp-thumb-tile { display: flex; flex-direction: column; align-items: center; cursor: pointer; user-select: none; }
.rmp-thumb-frame {
  position: relative; width: 100%; aspect-ratio: 3/4;
  border: 2px dashed var(--border, #cbd5e1); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; padding: 10px;
  transition: border-color .15s ease;
}
.rmp-thumb-tile:hover .rmp-thumb-frame { border-color: var(--brand, #2563eb); }
.rmp-thumb-canvas-wrap {
  width: 100%; height: 100%; border-radius: 4px; overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.12); background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.rmp-thumb-canvas-wrap img, .rmp-thumb-canvas-wrap canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.rmp-thumb-label { margin-top: 8px; font-size: .82rem; color: var(--txt-2, #64748b); }

.rmp-thumb-tile.rmp-thumb-selected .rmp-thumb-label { color: var(--txt-3, #cbd5e1); }
.rmp-thumb-trash {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  pointer-events: none;
}
.rmp-thumb-trash i { color: var(--red, #ef4444); font-size: 2.4rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.rmp-thumb-tile.rmp-thumb-selected .rmp-thumb-trash { display: flex; }

.rmp-sidebar {
  flex: 0 0 320px; background: var(--surface, #fff);
  border-left: 4px solid var(--brand, #2563eb);
  padding: 26px 28px; display: flex; flex-direction: column;
}
.rmp-sidebar h2 { margin: 0 0 16px; font-size: 1.4rem; font-weight: 800; color: var(--txt, #0f172a); }
.rmp-info-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--brand-light, #e0f2fe); color: var(--txt, #0c4a6e);
  border-radius: 10px; padding: 12px 14px; font-size: .82rem; line-height: 1.4;
  margin-bottom: 18px;
}
.rmp-info-banner i { color: #0284c7; margin-top: 1px; }
.rmp-total-pages { font-size: .92rem; color: var(--txt, #0f172a); margin-bottom: 18px; }
.rmp-sidebar-label { font-weight: 700; font-size: .88rem; color: var(--txt, #0f172a); margin-bottom: 8px; }
.rmp-sidebar-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0); font-size: .9rem;
  background: var(--page-bg, #f8fafc); color: var(--txt, #0f172a);
}
.rmp-sidebar-spacer { flex: 1; min-height: 18px; }
.rmp-remove-btn {
  width: 100%; border: none; border-radius: 12px; padding: 14px 18px;
  background: linear-gradient(135deg, var(--brand, #2563eb), var(--brand-dark, #1d4ed8));
  color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 10px 24px rgba(37,99,235,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.rmp-remove-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(37,99,235,.45); }
.rmp-remove-btn:active { transform: translateY(0); }
.rmp-start-over {
  margin-top: 10px; width: 100%; background: none; border: none; cursor: pointer;
  font-size: .82rem; color: var(--txt-2, #64748b); padding: 6px 0;
}
.rmp-start-over:hover { color: var(--brand, #2563eb); }

@media (max-width: 760px) {
  .rmp-workspace { flex-direction: column; }
  .rmp-sidebar { flex: none; border-left: none; border-top: 4px solid var(--brand, #2563eb); }
}

/* ── Processing screen — identical ring + step pattern as Transfer. ── */
.rmp-processing { padding: 10px 0 4px; }

.rmp-ring-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto 18px; }
.rmp-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.rmp-ring-track { fill: none; stroke: var(--border, #e2e8f0); stroke-width: 8; }
.rmp-ring-fill {
  fill: none; stroke: var(--brand, #2563eb); stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset .2s ease;
  filter: drop-shadow(0 0 6px rgba(37,99,235,.45));
}
.rmp-ring-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--txt, #0f172a);
}
.rmp-ring-count { font-size: 2.1rem; line-height: 1; }
.rmp-ring-percent { font-size: 1.1rem; opacity: .7; margin-left: 2px; }

.rmp-process-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-bottom: 22px;
}
.rmp-process-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700;
  color: var(--txt-2, #64748b);
  opacity: .55;
  transition: opacity .2s ease;
}
.rmp-process-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface, #fff);
  border: 2px solid var(--border, #e2e8f0);
  color: var(--txt-2, #64748b);
  font-size: .9rem;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.rmp-process-line { width: 36px; height: 2px; background: var(--border, #e2e8f0); }
.rmp-process-step.rmp-step-active { opacity: 1; }
.rmp-process-step.rmp-step-active .rmp-process-icon {
  border-color: var(--brand, #2563eb);
  color: var(--brand, #2563eb);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
  animation: rmpPulseStep 1.3s ease-in-out infinite;
}
.rmp-process-step.rmp-step-done { opacity: 1; }
.rmp-process-step.rmp-step-done .rmp-process-icon {
  border-color: #16a34a; color: #fff; background: #16a34a;
}
@keyframes rmpPulseStep {
  0%, 100% { box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
  50%      { box-shadow: 0 0 0 8px rgba(37,99,235,.04); }
}
@media (prefers-reduced-motion: reduce) {
  .rmp-process-step.rmp-step-active .rmp-process-icon { animation: none; }
}

.rmp-progress-text { font-size: .85rem; margin-top: 10px; color: var(--txt, #0f172a); font-weight: 600; text-align: center; }

/* ── Result screen ── */
.rmp-result-icon { text-align: center; font-size: 2.6rem; color: #16a34a; margin-bottom: 6px; }
.rmp-autosave { margin-top: 10px; text-align: center; font-size: .82rem; color: var(--txt-2, #64748b); }

.hidden { display: none !important; }
#rmpScope .controls.hidden { display: none !important; }
