/* ==========================================================================
   Pivora PDF — Modern SaaS Design System & Global Stylesheet
   Direction: Bi-directional (RTL Arabic / LTR English)
   Aesthetics: Clean, Modern SaaS, Glassmorphism, Micro-interactions
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Brand Palette */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-active: #3730a3;
  --primary-soft: #eef2ff;
  --primary-soft-hover: #e0e7ff;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --primary-glow: rgba(79, 70, 229, 0.28);

  /* Functional Colors */
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --info: #0ea5e9;
  --info-soft: #f0f9ff;

  /* Surfaces & Backgrounds (Light Theme) */
  --bg-body: #f8fafc;
  --bg-subtle: #f1f5f9;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-sunken: #f8fafc;
  --surface-hover: #f1f5f9;

  /* Glassmorphism & Header */
  --header-bg: rgba(255, 255, 255, 0.82);
  --header-border: rgba(226, 232, 240, 0.8);
  --card-glass: rgba(255, 255, 255, 0.92);

  /* Lines & Borders */
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --line-focus: #6366f1;

  /* Typography */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-inverse: #ffffff;

  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px -1px rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 32px -4px rgba(15, 23, 42, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 24px 48px -6px rgba(15, 23, 42, 0.14);
  --shadow-glow: 0 0 24px -2px var(--primary-glow);

  /* Border Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  /* Font Families */
  --font-latin: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "Cairo", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s var(--ease);
  --transition-normal: 0.25s var(--ease);
  --transition-slow: 0.4s var(--ease);
}

/* Dark Theme Tokens */
[data-theme="dark"] {
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-active: #4f46e5;
  --primary-soft: rgba(99, 102, 241, 0.14);
  --primary-soft-hover: rgba(99, 102, 241, 0.22);
  --primary-glow: rgba(99, 102, 241, 0.35);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.12);

  --bg-body: #090d16;
  --bg-subtle: #0f172a;
  --surface: #131b2e;
  --surface-elevated: #1a233a;
  --surface-sunken: #0b1120;
  --surface-hover: #1e293b;

  --header-bg: rgba(9, 13, 22, 0.82);
  --header-border: rgba(30, 41, 59, 0.7);
  --card-glass: rgba(19, 27, 46, 0.88);

  --line: #1e293b;
  --line-strong: #334155;
  --line-focus: #818cf8;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  --text-inverse: #0f172a;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 32px -4px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 48px -6px rgba(0, 0, 0, 0.65);
}

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

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

body {
  min-height: 100vh;
  color: var(--text-main);
  background-color: var(--bg-body);
  background-image:
    radial-gradient(ellipse 900px 500px at 50% -100px, var(--primary-glow), transparent 60%),
    radial-gradient(ellipse 600px 400px at 100% 30%, rgba(124, 58, 237, 0.08), transparent 50%),
    radial-gradient(ellipse 600px 400px at 0% 70%, rgba(14, 165, 233, 0.06), transparent 50%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-family: var(--font-latin);
  font-size: 15px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[lang="ar"] body,
html[dir="rtl"] body {
  font-family: var(--font-arabic);
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Layout Containers
   -------------------------------------------------------------------------- */
.wrap {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}

.narrow {
  width: min(720px, calc(100% - 40px));
  margin-inline: auto;
}

.section {
  padding-block: 56px;
}

.section-tight {
  padding-block: 28px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.25;
}

.section-head p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.text-link {
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.text-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   4. Header & Navigation (Frosted Glass & Sticky)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  user-select: none;
}

.brand:hover {
  color: var(--text-main);
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
  transition: transform var(--transition-normal);
}

.brand:hover .logo {
  transform: scale(1.05) rotate(2deg);
}

.logo svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.brand-text strong {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main) 60%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text small {
  color: var(--text-subtle);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}

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

.nav-link.is-active {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 10px;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.menu-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--text-main);
  border-radius: 99px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   5. Buttons, Chips & Badges
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  color: var(--text-main);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.btn-primary {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #ffffff !important;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1.5px);
}

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

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-muted);
}

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

.btn-lg {
  min-height: 52px;
  padding: 0 26px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--line-strong);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }
html:not([data-theme="dark"]) .i-sun { display: none; }
html:not([data-theme="dark"]) .i-moon { display: block; }

.lang-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-link:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  color: var(--primary);
}

.lang-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  line-height: 1.3;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  border: 1px solid rgba(79, 70, 229, 0.18);
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--success-soft);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 600;
}

.privacy-chip svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* --------------------------------------------------------------------------
   6. Hero Section
   -------------------------------------------------------------------------- */
.hero {
  padding-block: 64px 40px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
}

.hero h1 .gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .lead {
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 28px;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Hero Showcase Visual */
.hero-preview {
  perspective: 1000px;
}

.preview-shell {
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  overflow: hidden;
  transition: transform var(--transition-slow);
}

.preview-shell:hover {
  transform: translateY(-4px);
}

.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunken);
}

.preview-bar-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-bar-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.preview-bar-dots span:nth-child(1) { background: #ff5f56; }
.preview-bar-dots span:nth-child(2) { background: #ffbd2e; }
.preview-bar-dots span:nth-child(3) { background: #27c93f; }

.preview-bar strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px;
}

.preview-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all var(--transition-fast);
}

.preview-tile:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.preview-tile em {
  font-style: normal;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Trust & Metrics Ribbon */
.stats-ribbon {
  margin-top: 48px;
  padding: 24px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item strong {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
}

.stat-item span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   7. Cards & Bento Grid (Why Pivora)
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card,
.info-card,
.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card:hover,
.info-card:hover,
.step-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.info-card .tool-ico,
.step-card .tool-ico {
  margin-bottom: 20px;
}

.info-card h3,
.step-card h3,
.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.info-card p,
.step-card p,
.card p {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.step-card {
  counter-increment: step-counter;
}

.step-num {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

/* --------------------------------------------------------------------------
   8. Tools Grid & Tool Cards
   -------------------------------------------------------------------------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  min-height: 190px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: all var(--transition-normal);
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  height: 3px;
  background: var(--accent, var(--primary));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent, var(--primary)) 40%, var(--line));
  box-shadow: var(--shadow-lg), 0 0 20px -5px color-mix(in srgb, var(--accent, var(--primary)) 25%, transparent);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tool-ico {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent, var(--primary)) 12%, var(--surface));
  color: var(--accent, var(--primary));
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.tool-card:hover .tool-ico {
  transform: scale(1.08);
}

.tool-ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-card h3 {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.tool-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex-grow: 1;
  margin-bottom: 12px;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.tool-card-footer svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  transition: transform var(--transition-fast);
}

html[dir="rtl"] .tool-card:hover .tool-card-footer svg {
  transform: translateX(-4px);
}

html[dir="ltr"] .tool-card:hover .tool-card-footer svg {
  transform: translateX(4px);
}

/* Category Filter Tabs */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 24px;
  scrollbar-width: thin;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.filter-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Search Input */
.search-box {
  position: relative;
  width: min(100%, 480px);
  margin-bottom: 20px;
}

.search-box svg {
  position: absolute;
  top: 50%;
  inset-inline-start: 16px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  padding-inline-start: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

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

/* --------------------------------------------------------------------------
   9. Workspace (The Core Application)
   -------------------------------------------------------------------------- */
.workspace-page {
  padding-block: 28px 64px;
}

.workspace-header {
  margin-bottom: 28px;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
}

/* Tool Rail / Sidebar */
.tool-rail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 18px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.tool-rail .search {
  width: 100%;
  margin-bottom: 14px;
}

.cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface-sunken);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px var(--primary-glow);
}

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-inline-end: 4px;
  scrollbar-width: thin;
}

.tool-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.tool-link:hover {
  background: var(--surface-hover);
}

.tool-link.is-active {
  background: var(--primary-soft);
  border-color: rgba(79, 70, 229, 0.2);
  color: var(--primary);
}

.tool-link .tool-ico {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
}

.tool-link strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.tool-link em {
  display: block;
  font-style: normal;
  color: var(--text-subtle);
  font-size: 0.78rem;
  line-height: 1.25;
}

.tool-link.is-active em {
  color: var(--primary);
  opacity: 0.85;
}

/* Workspace Main Stage */
.workspace-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 3-Step Progress Stepper */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

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

.step i {
  display: block;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--line);
  transition: background var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.step.is-on i {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.step span {
  font-size: 0.82rem;
  color: var(--text-subtle);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.step.is-on span {
  color: var(--primary);
  font-weight: 700;
}

/* Modern Dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 36px 24px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-xl);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.dropzone-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  transition: transform var(--transition-fast);
}

.dropzone:hover .dropzone-icon {
  transform: translateY(-4px) scale(1.05);
}

.dropzone-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.dropzone strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.dropzone span {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 360px;
}

.dropzone-badge {
  margin-top: 14px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-subtle);
}

/* File List & File Cards */
.file-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 0;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  transition: all var(--transition-fast);
}

.file-list li:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.file-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.file-details {
  min-width: 0;
}

.file-name {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.file-size {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Settings Panels */
.settings {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.settings h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-main);
}

.settings label,
.form label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
  margin-bottom: 16px;
}

.settings input[type="text"],
.settings input[type="password"],
.settings input[type="number"],
.settings select,
.form input,
.form textarea,
.result textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.settings input:focus,
.settings select:focus,
.form input:focus,
.form textarea:focus,
.result textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.settings input[type="range"] {
  display: block;
  width: 100%;
  margin-top: 10px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Signature Canvas */
.sign-pad {
  width: 100%;
  max-width: 540px;
  height: 190px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: #ffffff;
  touch-action: none;
  margin: 10px 0;
}

/* Camera Scanner Box */
.scanner-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 16px;
}

.scanner-box video {
  width: 100%;
  max-height: 320px;
  background: #090d16;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

/* Preview Stage */
.preview-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.preview-stage {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  padding: 16px;
  margin: 14px 0;
  display: grid;
  place-items: center;
}

.preview-stage canvas {
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xs);
  cursor: crosshair;
  touch-action: none;
}

.thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 2px;
}

.thumb {
  border: 2px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 6px;
  min-width: 90px;
  cursor: grab;
  text-align: center;
  transition: all var(--transition-fast);
}

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

.thumb canvas {
  width: 78px;
  height: auto;
  margin: 0 auto 4px;
  border-radius: 4px;
}

.thumb span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-subtle);
}

/* Dynamic Multi-Stage Progress Bar */
.progress-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-block: 16px;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--line);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Result / Success Card */
.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  margin-block: 20px;
  animation: scale-up 0.3s var(--ease);
}

@keyframes scale-up {
  0% { opacity: 0; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

.result-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.result-icon-wrap svg {
  width: 32px;
  height: 32px;
  stroke-width: 2.4;
}

.result-card h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.result-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 440px;
  margin: 0 auto 24px;
}

.result-card .actions {
  justify-content: center;
  gap: 12px;
}

/* Sticky Action Bar */
.sticky-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

/* Notice / Alerts */
.notice {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block: 12px;
}

.notice.ok {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.notice.err {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-xl);
  animation: toast-in 0.3s var(--ease);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toast-in {
  0% { opacity: 0; transform: translateY(14px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
}

/* --------------------------------------------------------------------------
   10. Secondary Pages (Features, Download, About, FAQ, Contact, Blog)
   -------------------------------------------------------------------------- */
.page-hero {
  padding-block: 52px 24px;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--text-main);
}

.page-hero .lead {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 24px;
}

/* Download Page Hub */
.download-hub {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 44px;
  box-shadow: var(--shadow-lg);
  margin-block: 20px;
}

.phone-mockup {
  position: relative;
  width: 270px;
  height: 520px;
  background: #0b1120;
  border-radius: 40px;
  border: 8px solid #1e293b;
  box-shadow: var(--shadow-xl), 0 0 30px rgba(79, 70, 229, 0.2);
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-screen {
  padding: 18px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.phone-notch {
  width: 100px;
  height: 16px;
  background: #1e293b;
  border-radius: 99px;
  margin: 0 auto 8px;
}

.qr-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  margin-top: 24px;
}

.qr-card svg {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

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

.faq summary {
  padding: 20px 24px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-inline-end: 2px solid var(--text-subtle);
  border-bottom: 2px solid var(--text-subtle);
  transform: rotate(45deg);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.faq[open] summary::after {
  transform: rotate(-135deg);
  border-color: var(--primary);
}

.faq[open] summary {
  color: var(--primary);
}

.faq p {
  padding: 0 24px 22px;
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

/* Contact Page Form & Cards */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 36px;
  align-items: start;
}

.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* Prose for Articles & Privacy */
.prose {
  line-height: 1.8;
  color: var(--text-muted);
  font-size: 1rem;
}

.prose h1, .prose h2, .prose h3 {
  color: var(--text-main);
  font-weight: 800;
  margin-block: 28px 12px;
  letter-spacing: -0.02em;
}

.prose h1 { font-size: 2.2rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.2rem; }

.prose p {
  margin-bottom: 18px;
}

.prose ul, .prose ol {
  margin-bottom: 22px;
  padding-inline-start: 24px;
}

.prose li {
  margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-sunken);
  padding: 56px 0 36px;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 56px;
}

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

.footer-brand strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

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

.footer-col h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--text-subtle);
}

/* --------------------------------------------------------------------------
   12. Responsive Breakpoints & Mobile Optimization
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .preview-shell {
    max-width: 540px;
    margin: 0 auto;
  }
  .workspace-layout {
    grid-template-columns: 1fr;
  }
  .tool-rail {
    position: static;
    max-height: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .download-hub {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    overflow-y: auto;
    z-index: 99;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-xl);
  }

  .nav.is-open {
    display: flex;
    animation: menu-slide-down 0.25s var(--ease);
  }

  @keyframes menu-slide-down {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
  }

  .nav-link {
    padding: 12px 16px;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
  }

  .nav-actions {
    margin-inline-start: 0;
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: stretch;
  }

  .nav-actions > * {
    flex: 1;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .dropzone {
    min-height: 180px;
    padding: 24px 16px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.95rem;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .file-list li {
    flex-direction: column;
    align-items: stretch;
  }
  .file-actions {
    justify-content: flex-end;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
