/* ==========================================================================
   PDF Merger Pro - Design System & Modern Glassmorphism Styling
   ========================================================================== */

:root {
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Tokens */
  --bg-main: #090D16;
  --bg-card: rgba(17, 24, 39, 0.72);
  --bg-card-hover: rgba(26, 36, 56, 0.85);
  --bg-card-elevated: rgba(30, 41, 59, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);
  --border-glow: rgba(99, 102, 241, 0.6);

  /* Brand Accents */
  --accent-primary: #6366F1;
  --accent-secondary: #8B5CF6;
  --accent-cyan: #06B6D4;
  --accent-pink: #EC4899;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;

  /* Typography Colors */
  --text-main: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #0F172A;

  /* Shadow & Glow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  --glow-primary: 0 0 25px rgba(99, 102, 241, 0.35);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Background Ambient Glows */
.background-glows {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.45;
  animation: pulseGlow 12s ease-in-out infinite alternate;
}

.glow-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #6366F1, transparent 70%);
  top: -100px;
  left: 10%;
}

.glow-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, #EC4899, transparent 70%);
  top: 25%;
  right: -100px;
  animation-delay: -4s;
}

.glow-3 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #06B6D4, transparent 70%);
  bottom: -150px;
  left: 20%;
  animation-delay: -8s;
}

@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.35; }
  50% { transform: scale(1.15) translate(30px, -20px); opacity: 0.55; }
  100% { transform: scale(0.95) translate(-20px, 30px); opacity: 0.4; }
}

/* Layout Container */
.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 13, 22, 0.7);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
  transition: transform var(--transition-fast);
}

.logo-icon:hover {
  transform: rotate(5deg) scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.badge-pro {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  background: linear-gradient(135deg, #EC4899, #F43F5E);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.system-pills {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
}

.pill-green {
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34D399;
  box-shadow: 0 0 8px #34D399;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.pill-blue {
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
}

/* Main Container */
.main-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  width: 100%;
  flex: 1;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #FFFFFF 30%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  font-weight: 400;
}

/* Card Workspace */
.card-workspace {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

.card-workspace::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-pink), transparent);
}

/* Dropzone */
.dropzone-area {
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.015);
  transition: all var(--transition-normal);
  position: relative;
}

.dropzone-area:hover, .dropzone-area.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.18) inset;
  transform: translateY(-2px);
}

.file-input-hidden {
  display: none;
}

.dropzone-icon-wrapper {
  width: 76px;
  height: 76px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
  transition: transform var(--transition-normal), color var(--transition-normal);
}

.dropzone-area:hover .dropzone-icon-wrapper,
.dropzone-area.dragover .dropzone-icon-wrapper {
  transform: scale(1.1) translateY(-4px);
  color: #38BDF8;
}

.dropzone-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.dropzone-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.dropzone-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.dropzone-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Files Stage */
.files-stage {
  animation: fadeIn 0.3s ease;
}

.files-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.files-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.files-counter {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: rgba(99, 102, 241, 0.15);
  color: #A5B4FC;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
}

.files-instruction {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.files-actions-top {
  display: flex;
  gap: 0.6rem;
}

/* File List & Items */
.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.file-list::-webkit-scrollbar {
  width: 6px;
}
.file-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.file-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  transition: all var(--transition-fast);
  cursor: grab;
  user-select: none;
}

.file-item:active {
  cursor: grabbing;
}

.file-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(2px);
}

.file-item.dragging {
  opacity: 0.4;
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  flex: 1;
}

.drag-handle {
  color: var(--text-muted);
  cursor: grab;
  display: flex;
  align-items: center;
  padding: 0.2rem;
}
.drag-handle:hover {
  color: var(--text-main);
}

.file-order-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.2));
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F87171;
  flex-shrink: 0;
}

.file-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.menu-title-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 520px;
}

.menu-label-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #A5B4FC;
  background: rgba(99, 102, 241, 0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.menu-title-input {
  flex: 1;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  outline: none;
  transition: all var(--transition-fast);
}

.menu-title-input:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.menu-title-input:focus {
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.file-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-original-name {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.meta-separator {
  color: rgba(255, 255, 255, 0.15);
}

.file-size {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.file-badge-pages {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.file-item-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: 1rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-icon-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Options Panel */
.options-panel {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.option-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-with-suffix {
  display: flex;
  align-items: center;
  max-width: 480px;
  position: relative;
}

.text-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 3.5rem;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.text-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-suffix {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  pointer-events: none;
}

.toggles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.toggle-control {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  cursor: pointer;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast);
}

.toggle-control:hover {
  background: rgba(255, 255, 255, 0.05);
}

.toggle-control input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0;
  margin-top: 2px;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle-control input[type="checkbox"]:checked + .toggle-switch {
  background: var(--accent-primary);
}

.toggle-control input[type="checkbox"]:checked + .toggle-switch::after {
  transform: translateX(18px);
}

.toggle-label-group {
  display: flex;
  flex-direction: column;
}

.toggle-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.toggle-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.15rem;
}

/* Action Footer */
.action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.summary-info {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.summary-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: #38BDF8;
}

/* Buttons */
.btn {
  font-family: var(--font-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.6);
  transform: translateY(-2px);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.btn-danger-hover:hover {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
}

.btn-lg {
  font-size: 1.05rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
}

/* Processing Stage */
.processing-stage {
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.4s ease;
}

.processing-spinner-box {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.pulse-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.4);
  animation: pulseRing 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.spinner-core {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.spin-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.processing-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.progress-bar-container {
  width: 100%;
  max-width: 480px;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366F1, #EC4899, #38BDF8);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

.progress-percentage {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #A5B4FC;
  margin-bottom: 2rem;
}

.processing-steps {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
  max-width: 460px;
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.step-bullet {
  font-weight: 700;
  font-size: 0.9rem;
}

.step-item.step-completed {
  color: #34D399;
}

.step-item.step-active {
  color: #FFFFFF;
  background: rgba(99, 102, 241, 0.12);
  font-weight: 600;
}

/* Result Stage */
.result-stage {
  padding: 3rem 1.5rem;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.success-icon-badge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
  animation: bounceSuccess 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceSuccess {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.result-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.result-filename {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: #38BDF8;
  margin-bottom: 2rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.text-gradient {
  background: linear-gradient(135deg, #38BDF8, #818CF8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Technical Features Section */
.features-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3.5rem;
}

.feature-card {
  background: rgba(17, 24, 39, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  backdrop-filter: blur(12px);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #22D3EE;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.icon-violet {
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.feature-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.feature-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Modal Preview */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-container {
  width: 100%;
  max-width: 1000px;
  height: 85vh;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(17, 24, 39, 0.95);
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body {
  flex: 1;
  background: #0B0F19;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: #1E293B;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.25s ease, fadeOut 0.25s ease 3.75s forwards;
}

.toast-success {
  border-left: 4px solid #34D399;
}

.toast-error {
  border-left: 4px solid #EF4444;
}

.toast-info {
  border-left: 4px solid #38BDF8;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  background: rgba(9, 13, 22, 0.6);
}

/* Utilities & Animations */
.hidden {
  display: none !important;
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 0.85rem;
    align-items: flex-start;
  }
  .system-pills {
    display: none;
  }
  .card-workspace {
    padding: 1.25rem;
  }
  .file-name {
    max-width: 180px;
  }
  .action-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-primary.btn-lg {
    width: 100%;
  }
}

/* ==========================================================================
   Seção de Doação & Apoio (PIX)
   ========================================================================== */

.pill-pink {
  color: #F472B6;
  border-color: rgba(244, 114, 182, 0.35);
  background: rgba(244, 114, 182, 0.08);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pill-pink:hover {
  background: rgba(244, 114, 182, 0.18);
  border-color: rgba(244, 114, 182, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.25);
}

.donation-section {
  margin-top: 3.5rem;
  scroll-margin-top: 5rem;
}

.donation-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(17, 24, 39, 0.85) 100%);
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(236, 72, 153, 0.08);
  position: relative;
  overflow: hidden;
}

.donation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #EC4899, #8B5CF6, transparent);
}

.donation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #F472B6;
  background: rgba(244, 114, 182, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.donation-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.donation-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.55;
  margin-bottom: 2rem;
}

.pix-container {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  flex-wrap: wrap;
}

.pix-qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.pix-qr-frame {
  background: #FFFFFF;
  padding: 0.75rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.pix-qr-frame:hover {
  transform: scale(1.02);
}

.pix-qr-image {
  display: block;
  width: 170px;
  height: 170px;
  border-radius: 4px;
}

.pix-scan-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pix-details-wrapper {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.pix-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pix-field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pix-copy-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.4rem 0.3rem 0.85rem;
  transition: border-color var(--transition-fast);
}

.pix-copy-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.pix-input-readonly {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #38BDF8;
  outline: none;
  width: 100%;
}

.btn-copy {
  flex-shrink: 0;
  gap: 0.4rem;
}

.pix-merchant-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pix-merchant-info strong {
  color: var(--text-secondary);
}

.result-support-box {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.2);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.link-highlight {
  color: #F472B6;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.link-highlight:hover {
  color: #EC4899;
}

/* ==========================================================================
   MENU DE FUNCIONALIDADES & FERRAMENTAS AVANÇADAS
   ========================================================================== */

/* Barra de Navegação Superior das Ferramentas */
.tools-nav-bar {
  margin-bottom: 2rem;
  width: 100%;
}

.tools-nav-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.tool-nav-btn {
  all: unset;
  box-sizing: border-box;
  font-family: var(--font-primary), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: left;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
}

.tool-nav-btn::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-pink));
  border-radius: var(--radius-full);
  transition: transform var(--transition-normal);
}

.tool-nav-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  color: var(--text-main);
}

.tool-nav-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(236, 72, 153, 0.12));
  border-color: var(--accent-primary);
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.35);
  color: #FFFFFF;
}

.tool-nav-btn.active::before {
  transform: translateX(-50%) scaleX(1);
}

.tool-btn-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #38BDF8;
  flex-shrink: 0;
  transition: all var(--transition-normal);
}

.tool-nav-btn.active .tool-btn-icon-box {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

.tool-btn-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tool-btn-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-btn-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-nav-btn.active .tool-btn-sub {
  color: #CBD5E1;
}

/* Barra do Documento Ativo (Cabeçalho nas ferramentas de 1 PDF) */
.active-doc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.doc-badge-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.doc-icon-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818CF8;
}

.doc-meta-texts {
  display: flex;
  flex-direction: column;
}

.doc-meta-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-all;
}

.doc-meta-details {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.doc-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Seletor de Modo Segmentado (Split & Extract) */
.split-mode-selector,
.extract-mode-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.mode-pill {
  position: relative;
  display: flex;
  cursor: pointer;
}

.mode-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-pill-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  width: 100%;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.mode-pill-content strong {
  font-size: 0.92rem;
  color: var(--text-main);
}

.mode-pill-content small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mode-pill input:checked + .mode-pill-content {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.mode-pill input:checked + .mode-pill-content strong {
  color: #38BDF8;
}

/* Caixas de Controle do Split */
.split-controls-box {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.input-with-helper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ranges-preview-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ranges-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.range-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 0.82rem;
  color: #C7D2FE;
  font-family: var(--font-mono);
}

.info-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--text-main);
  font-size: 0.9rem;
}

.info-alert-box strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: #38BDF8;
}

.highlight-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #38BDF8;
}

/* Barra de Rotação em Lote */
.batch-rotate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.batch-group-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.batch-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Barra de Seleção do Extrair Páginas */
.extract-selection-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.selection-input-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.selection-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.selection-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #FFFFFF;
}

/* Indicador de Carregamento de Miniaturas */
.thumbnails-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.thumbnails-loading.active {
  display: flex;
}

.spinner-mini {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.grid-instructions-bar {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

/* Grade de Miniaturas de Páginas (Organizar, Girar e Extrair) */
.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
  min-height: 180px;
}

/* Card Individual de Página */
.page-card {
  display: flex;
  flex-direction: column;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  position: relative;
  transition: all var(--transition-normal);
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.page-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Card Header */
.page-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.page-badge-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.page-badge-orig {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.page-card-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.page-card-drag-handle:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

/* Canvas / Imagem de Preview da Página */
.page-card-preview-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.414; /* Proporção A4 */
  background: #0B0F19;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.page-thumbnail-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #FFFFFF;
}

/* Indicador de Rotação */
.page-rotation-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #38BDF8;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

/* Ações no Rodapé do Card (Organizar e Girar) */
.page-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.3rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.card-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  transform: scale(1.1);
}

.card-action-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* Estados de Drag and Drop */
.page-card.dragging {
  opacity: 0.4;
  border: 2px dashed var(--accent-primary);
  transform: scale(0.95);
}

.page-card.drag-over {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
  transform: scale(1.03);
}

/* Estado de Seleção no Extrair Páginas */
.page-card-selectable {
  cursor: pointer;
}

.page-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 5;
}

.page-card.selected {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.page-card.selected .page-select-checkbox {
  background: #10B981;
  border-color: #10B981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.page-card.selected .page-select-checkbox svg {
  display: block;
}

.page-select-checkbox svg {
  display: none;
  stroke: #FFFFFF;
}

.page-card:not(.selected) {
  opacity: 0.72;
}

.page-card:not(.selected):hover {
  opacity: 1;
}

/* Responsividade do Menu de Ferramentas */
@media (max-width: 1024px) {
  .tools-nav-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .tools-nav-container {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .tool-nav-btn {
    padding: 0.75rem 0.85rem;
  }

  .thumbnails-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
}

/* ==========================================================================
   Tool Categories Ribbon
   ========================================================================== */
.tool-categories-ribbon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.tool-categories-ribbon::-webkit-scrollbar {
  display: none;
}

.tool-category-pill {
  all: unset;
  box-sizing: border-box;
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tool-category-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(99, 102, 241, 0.3);
}

.tool-category-pill.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.15));
  border-color: var(--accent-primary);
  color: #FFFFFF;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   Security & Conversion Card Boxes
   ========================================================================== */
.security-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.security-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.security-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.security-box-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.security-box-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.sub-section-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.65rem;
}

/* Passwords Grid */
.passwords-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .passwords-grid {
    grid-template-columns: 1fr;
  }
}

.pwd-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pwd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pwd-input-wrap .text-input {
  width: 100%;
  padding-right: 2.75rem;
}

.btn-pwd-toggle {
  all: unset;
  position: absolute;
  right: 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color var(--transition-fast);
  user-select: none;
}

.btn-pwd-toggle:hover {
  color: var(--text-main);
}

.pwd-meter-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.2rem;
}

.pwd-meter-bar {
  height: 4px;
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.pwd-meter-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--meter-pct, 0%);
  background: var(--meter-color, #EF4444);
  transition: width 0.3s ease, background 0.3s ease;
}

.pwd-meter-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field-help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Encryption & Radio Cards */
.encryption-radios,
.p2w-pages-radios {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .encryption-radios,
  .p2w-pages-radios {
    grid-template-columns: 1fr;
  }
}

.enc-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.enc-radio-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
}

.enc-radio-card:has(input:checked) {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

.enc-radio-card input[type="radio"] {
  accent-color: var(--accent-primary);
  margin-top: 0.2rem;
  cursor: pointer;
}

.enc-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.enc-card-body strong {
  font-size: 0.88rem;
  color: var(--text-main);
}

.enc-card-body small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Preset Chips Grid */
.preset-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}

.preset-chip-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(244, 63, 94, 0.3);
}

.preset-chip-card:has(input:checked) {
  background: rgba(244, 63, 94, 0.1);
  border-color: var(--accent-rose);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.25);
}

.preset-chip-card input[type="checkbox"] {
  accent-color: var(--accent-rose);
  cursor: pointer;
}

.preset-chip-content {
  display: flex;
  flex-direction: column;
}

.preset-chip-content strong {
  font-size: 0.82rem;
  color: var(--text-main);
}

.preset-chip-content small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Custom Terms Box */
.custom-terms-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.term-input-row {
  display: flex;
  gap: 0.5rem;
}

.term-input-row .text-input {
  flex: 1;
}

.terms-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 28px;
}

.term-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #FECDD3;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  animation: fadeIn 0.2s ease;
}

.term-tag-remove {
  all: unset;
  cursor: pointer;
  color: rgba(254, 205, 211, 0.6);
  font-weight: bold;
  font-size: 0.95rem;
  line-height: 1;
  transition: color var(--transition-fast);
}

.term-tag-remove:hover {
  color: #FFFFFF;
}

/* Custom Range Inputs */
.custom-range-inputs {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
}

.range-inputs-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.range-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.range-sublabel {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.range-sep {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 1rem;
}

.num-input {
  width: 90px;
  padding: 0.5rem 0.65rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.num-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* Word to PDF Highlight */
.word-info-highlight {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.info-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #C7D2FE;
}



