/* ==========================================================================
   SMARTDOCIFY - MULTIPLE ID CARDS ON A4 STYLESHEET
   Matches SmartDocify Design System: Dark & Light themes, modern elevation,
   mobile-responsive, multi-page support, high-DPI print styles.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS VARIABLES & THEME TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Dark Theme Default */
  --bg-page: #080d1a;
  --bg-surface: #111c30;
  --bg-surface-elevated: #16233b;
  --bg-surface-hover: #1c2c48;
  --bg-card: rgba(17, 28, 48, 0.75);

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-glow: rgba(37, 99, 235, 0.28);

  --secondary: #7c3aed;
  --secondary-hover: #6d28d9;
  --secondary-light: #8b5cf6;

  --success: #10b981;
  --success-hover: #059669;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.28);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.28);

  --warning: #f59e0b;
  --whatsapp: #25D366;
  --whatsapp-hover: #1ebd5a;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #ffffff;

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(37, 99, 235, 0.48);
  --border-focus: #3b82f6;

  /* Elevation & Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-paper: 0 14px 40px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.22);

  /* Geometry & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Fonts & Container */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --container-max: 1200px;
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-page: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-surface-hover: #e2e8f0;
  --bg-card: #ffffff;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-inverse: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-card: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(37, 99, 235, 0.5);
  --border-focus: #2563eb;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-paper: 0 12px 35px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Glow */
body::before {
  content: '';
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 960px;
  height: 520px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(124, 58, 237, 0.06) 50%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   3. SITE HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 13, 26, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s ease;
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.9);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 1.15rem;
  color: var(--text-main);
}

.logo-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.35));
}

.logo-svg {
  width: 32px;
  height: 32px;
}

.logo-text {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .logo-text {
  background: linear-gradient(135deg, #0f172a 30%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Desktop Nav */
.desktop-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

.nav-link.active {
  color: var(--primary-light);
  background: rgba(37, 99, 235, 0.12);
  font-weight: 600;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.action-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.ui-icon {
  width: 20px;
  height: 20px;
}

.icon-sun { display: block; }
.icon-moon { display: none; }

[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.menu-toggle {
  display: none;
}

.hamburger-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

.hamburger-line {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
}

/* Mobile Drawer */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  z-index: 210;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.drawer-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.drawer-close-btn svg {
  width: 20px;
  height: 20px;
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-nav-link {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  color: var(--primary-light);
  background: rgba(37, 99, 235, 0.12);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   4. HERO SECTION
   -------------------------------------------------------------------------- */
.tool-hero {
  padding: 48px 0 28px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: #34d399;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.12);
}

.privacy-badge svg {
  width: 16px;
  height: 16px;
}

[data-theme="light"] .privacy-badge {
  color: #065f46;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 16px;
}

.user-types-pill {
  display: inline-block;
  padding: 5px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   5. WORKSPACE CARD & PANELS
   -------------------------------------------------------------------------- */
.tool-workspace {
  padding-bottom: 60px;
  position: relative;
  z-index: 2;
}

.workspace-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.section-badge-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.badge-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
}

.panel-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   6. UPLOAD PANEL & DRAG-AND-DROP REORDERABLE THUMBNAILS
   -------------------------------------------------------------------------- */
.upload-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dropzone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  background: rgba(37, 99, 235, 0.03);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  outline: none;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary-light);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.dropzone:focus-visible {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dropzone-icon-box {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: rgba(37, 99, 235, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  margin-bottom: 6px;
  transition: transform 0.2s ease;
}

.dropzone:hover .dropzone-icon-box {
  transform: scale(1.08);
}

.dropzone-svg {
  width: 34px;
  height: 34px;
}

.dropzone-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.dropzone-divider {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}

.btn-browse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Uploaded Thumbnails Tray */
.thumbnails-container {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.thumbnails-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.thumbnails-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--primary-light);
}

.thumbnails-count-badge svg {
  width: 18px;
  height: 18px;
}

.reorder-tip {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-dim);
}

.thumbnails-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.thumbnails-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

/* Draggable Thumbnail Card */
.thumb-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: grab;
  user-select: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.thumb-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.thumb-card.dragging {
  opacity: 0.4;
  border: 2px dashed var(--primary);
  cursor: grabbing;
}

.thumb-card.drag-over {
  border-color: var(--primary-light);
  transform: scale(1.03);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}

.thumb-img-wrapper {
  width: 100%;
  aspect-ratio: 1.58; /* Standard ID card ratio */
  background: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb-card-num-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.85);
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.thumb-btn-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.85);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.thumb-btn-remove:hover {
  opacity: 1;
  transform: scale(1.1);
  background: var(--danger);
}

.thumb-btn-remove svg {
  width: 13px;
  height: 13px;
}

.thumb-meta {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thumb-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.thumb-size {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   7. CUSTOMIZATION CONTROLS
   -------------------------------------------------------------------------- */
.customization-panel {
  border-top: 1px solid var(--border-subtle);
  padding-top: 32px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-hint {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--text-dim);
}

.control-value-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-light);
  background: rgba(37, 99, 235, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* Select Inputs */
.select-wrapper {
  position: relative;
}

.form-select {
  width: 100%;
  padding: 10px 38px 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.92rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-muted);
  pointer-events: none;
}

/* Segmented Control */
.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface-elevated);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.segment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

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

.segment-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Custom Size Inputs */
.custom-dimension-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dim-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dim-field label {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.dim-input {
  width: 100% !important;
}

.dim-multiplier {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 18px;
}

/* Range & Number Input Group */
.range-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-range {
  flex: 1;
  height: 6px;
  background: var(--bg-surface-hover);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-number {
  width: 65px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
  transition: all 0.2s ease;
}

.form-number:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* --------------------------------------------------------------------------
   8. LIVE PRINT PREVIEW PANEL
   -------------------------------------------------------------------------- */
.preview-panel {
  border-top: 1px solid var(--border-subtle);
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.preview-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-header-left .section-badge-header {
  margin-bottom: 4px;
}

.preview-spec-badge {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  display: inline-block;
  width: fit-content;
}

/* Pagination Toolbar */
.preview-pagination-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-elevated);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.page-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.page-nav-btn:hover:not(:disabled) {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

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

.page-nav-btn svg {
  width: 16px;
  height: 16px;
}

.page-counter-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-light);
}

.page-pills-container {
  display: flex;
  gap: 6px;
  margin-left: 6px;
}

.page-pill {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-pill:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.page-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Canvas Viewport */
.canvas-viewport {
  background: #050811;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  overflow: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .canvas-viewport {
  background: #cbd5e1;
}

.sheet-paper-container {
  display: inline-block;
  box-shadow: var(--shadow-paper);
  border-radius: 4px;
  background: #ffffff;
  line-height: 0;
  transition: transform 0.2s ease;
  max-width: 100%;
}

.sheet-canvas {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
}

.preview-footer-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.preview-footer-note svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary-light);
}

/* --------------------------------------------------------------------------
   9. ACTIONS PANEL & BUTTONS
   -------------------------------------------------------------------------- */
.actions-panel {
  border-top: 1px solid var(--border-subtle);
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Filename Input */
.filename-container {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.filename-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.filename-label svg {
  width: 18px;
  height: 18px;
  color: var(--primary-light);
}

.filename-input-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 260px;
  position: relative;
}

.form-input-filename {
  width: 100%;
  padding: 10px 100px 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.form-input-filename:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.filename-ext-badge {
  position: absolute;
  right: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
  pointer-events: none;
}

/* Primary Action Buttons */
.actions-group-primary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-action {
  padding: 14px 22px;
  font-size: 1.02rem;
  box-shadow: var(--shadow-md);
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-print {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
}

.btn-print:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.btn-download-pdf {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #ffffff;
}

.btn-download-pdf:hover {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.btn-download-img {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
}

.btn-download-img:hover {
  background: linear-gradient(135deg, #10b981, #059669);
}

.btn-icon {
  width: 20px;
  height: 20px;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.84rem;
}

.btn-outline {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.btn-danger-outline {
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: #f87171;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.22);
}

/* Secondary / Social Share Buttons */
.actions-group-secondary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.share-group-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.btn-share {
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

.btn-share:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
  transform: translateY(-1px);
}

.share-icon {
  width: 18px;
  height: 18px;
}

.btn-whatsapp {
  color: #25D366;
  border-color: rgba(37, 211, 102, 0.25);
  background: rgba(37, 211, 102, 0.08);
}

.btn-whatsapp:hover {
  background: rgba(37, 211, 102, 0.16);
  border-color: #25D366;
}

/* Button Loading State */
.btn-loading {
  opacity: 0.8;
  cursor: wait !important;
  pointer-events: none;
}

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

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

/* --------------------------------------------------------------------------
   10. TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease;
}

.toast-success {
  background: #065f46;
  color: #ecfdf5;
  border: 1px solid #059669;
}

.toast-error {
  background: #991b1b;
  color: #fef2f2;
  border: 1px solid #dc2626;
}

.toast-info {
  background: #1e3a8a;
  color: #eff6ff;
  border: 1px solid #2563eb;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   11. ALSO TRY THESE TOOLS SECTION
   -------------------------------------------------------------------------- */
.related-tools-section {
  padding: 60px 0;
  border-top: 1px solid var(--border-subtle);
}

.section-title-wrap {
  margin-bottom: 40px;
}

.text-center {
  text-align: center;
}

.section-heading {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.section-subheading {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.tool-card {
  display: flex;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.25s ease;
}

.tool-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.tool-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.tool-card:hover .tool-card-icon {
  transform: scale(1.1);
}

.tool-card-icon svg {
  width: 24px;
  height: 24px;
}

.tool-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
}

.tool-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   12. HOW TO USE SECTION
   -------------------------------------------------------------------------- */
.how-to-use-section {
  padding: 60px 0;
  background: rgba(255, 255, 255, 0.015);
  border-top: 1px solid var(--border-subtle);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
}

.step-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.step-number {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dim);
  opacity: 0.4;
}

.step-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.step-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.step-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.step-card-text {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   13. SEO CONTENT ARTICLE SECTION
   -------------------------------------------------------------------------- */
.seo-content-section {
  padding: 60px 0;
  border-top: 1px solid var(--border-subtle);
}

.seo-article-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 40px;
}

.seo-heading {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.seo-body {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.seo-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 14px;
}

.seo-body strong {
  color: var(--text-main);
}

.seo-body ul {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   14. FAQ ACCORDION SECTION
   -------------------------------------------------------------------------- */
.faq-section {
  padding: 60px 0 80px;
  border-top: 1px solid var(--border-subtle);
}

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

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-question {
  width: 100%;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.faq-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  color: var(--primary-light);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.faq-icon svg {
  width: 16px;
  height: 16px;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
  background: rgba(37, 99, 235, 0.2);
}

.faq-answer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
}

.faq-answer[hidden] {
  display: none;
}

.faq-content {
  padding: 18px 24px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   15. SITE FOOTER (MULTI-COLUMN & RESPONSIVE)
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: #050811;
  padding: 60px 0 30px;
  margin-top: auto;
}

[data-theme="light"] .site-footer {
  background: #ffffff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 48px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-col-brand {
  gap: 16px;
}

.footer-tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 320px;
}

.footer-privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
}

.footer-privacy-badge svg {
  width: 16px;
  height: 16px;
}

.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   16. PRINT-ONLY MULTI-PAGE STYLES
   -------------------------------------------------------------------------- */
.print-container {
  display: none;
}

@media print {
  @page {
    margin: 0;
    size: auto;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body::before,
  .site-header,
  .tool-hero,
  .workspace-card,
  .related-tools-section,
  .how-to-use-section,
  .seo-content-section,
  .faq-section,
  .site-footer,
  .mobile-nav-backdrop,
  .mobile-nav-drawer,
  .toast-container {
    display: none !important;
  }

  .print-container {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    margin: 0;
    padding: 0;
  }

  .print-page-image {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    display: block;
    page-break-after: always;
    break-after: page;
  }

  .print-page-image:last-child {
    page-break-after: avoid;
    break-after: avoid;
  }
}

/* --------------------------------------------------------------------------
   17. RESPONSIVE BREAKPOINTS (MOBILE & TABLET)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.3rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer-col-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-title {
    font-size: 1.95rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .workspace-card {
    padding: 20px 16px;
    gap: 30px;
  }

  .dropzone {
    padding: 32px 16px;
  }

  .dropzone-title {
    font-size: 1.15rem;
  }

  .controls-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .actions-group-primary {
    grid-template-columns: 1fr;
  }

  .btn-action {
    width: 100%;
    justify-content: center;
  }

  .actions-group-secondary {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-share {
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .canvas-viewport {
    padding: 20px 10px;
    min-height: 380px;
  }

  .seo-article-card {
    padding: 24px 18px;
  }
}
