/* ============================================================
   KidsPrintableGenerator — Design System
   Modern SaaS UI: Clean, Professional, Friendly
   Google Font: Inter
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* ─── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Brand Colors — Electric Violet & Indigo with Coral Accents */
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-primary-deep: #4338ca;
  --color-primary-light: #818cf8;
  --color-primary-50: #f5f3ff;
  --color-primary-100: #ede9fe;

  /* Playful & Energetic Accents */
  --color-accent: #ff6b6b;
  --color-accent-dark: #f97316;
  --color-accent-coral: #ff6b6b;
  --color-accent-peach: #fff1f2;
  --color-success: #10b981;
  --color-success-light: #ecfdf5;
  --color-danger: #f43f5e;
  --color-warning: #f59e0b;
  --color-info: #0ea5e9;

  /* Surfaces & Warm Neutrals */
  --color-canvas: #faf9f6;
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;

  /* Sizing & Curvature */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Elevated Soft Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(15 23 42 / 0.04);
  --shadow-sm: 0 2px 4px 0 rgb(15 23 42 / 0.06), 0 1px 2px -1px rgb(15 23 42 / 0.06);
  --shadow-md: 0 6px 12px -2px rgb(15 23 42 / 0.08), 0 3px 6px -3px rgb(15 23 42 / 0.08);
  --shadow-lg: 0 14px 24px -4px rgb(15 23 42 / 0.09), 0 6px 12px -5px rgb(15 23 42 / 0.06);
  --shadow-xl: 0 24px 36px -6px rgb(99 102 241 / 0.12), 0 12px 18px -8px rgb(15 23 42 / 0.06);
  --shadow-glow: 0 0 0 4px rgb(99 102 241 / 0.20);
  --shadow-accent-glow: 0 0 0 4px rgb(255 107 107 / 0.25);

  /* Gradients (Math Themed) */
  --gradient-primary: #4f46e5;
  --gradient-accent: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(14, 165, 233, 0.06) 100%);
  --gradient-dark: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  --gradient-hero: radial-gradient(1100px 520px at 85% 0%, rgba(79, 70, 229, 0.14) 0%, rgba(14, 165, 233, 0.08) 45%, transparent 75%);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 350ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --content-max-width: 1280px;

  /* Dedicated Kids Math SaaS Tokens */
  --color-math-blue: #4338ca;
  --color-math-indigo: #4f46e5;
  --color-math-coral: #ff6b6b;
  --color-math-amber: #f59e0b;
  --color-math-mint: #059669;
  --color-math-sky: #0284c7;
  --color-math-purple: #7c3aed;
  --color-math-rose: #e11d48;
  --color-math-surface: #f8faff;
  --color-math-border: #c7d2fe;

  /* SVG Math Pattern Token (+, -, x, /, =, pi, sqrt, %, sum, !=, delta, dots) */
  --bg-math-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='%236366f1' fill-opacity='0.045' font-family='sans-serif' font-weight='900'%3E%3Ctext x='24' y='38' font-size='26'%3E%2B%3C/text%3E%3Ctext x='124' y='44' font-size='28'%3E%C3%97%3C/text%3E%3Ctext x='174' y='85' font-size='22'%3E%3D%3C/text%3E%3Ctext x='36' y='112' font-size='28'%3E%C3%B7%3C/text%3E%3Ctext x='135' y='132' font-size='26'%3E%E2%88%92%3C/text%3E%3Ctext x='22' y='180' font-size='22'%3E%CF%80%3C/text%3E%3Ctext x='86' y='178' font-size='26'%3E%E2%88%9A%3C/text%3E%3Ctext x='162' y='178' font-size='20'%3E%25%3C/text%3E%3Ctext x='168' y='36' font-size='22'%3E%E2%88%91%3C/text%3E%3Ctext x='82' y='74' font-size='22'%3E%E2%89%A0%3C/text%3E%3Cpolygon points='98,114 110,134 86,134' stroke='%236366f1' stroke-width='2.5' stroke-opacity='0.045' fill='none'/%3E%3Ccircle cx='68' cy='46' r='3.5' fill='%236366f1' fill-opacity='0.045'/%3E%3Ccircle cx='148' cy='90' r='3' fill='%236366f1' fill-opacity='0.045'/%3E%3Ccircle cx='34' cy='144' r='2.5' fill='%236366f1' fill-opacity='0.045'/%3E%3C/g%3E%3C/svg%3E");
}

/* ─── Kids Math Blueprint & Graph Textures ────────────────────── */
.math-symbols-pattern {
  background-color: #f8fafc;
  background-image: var(--bg-math-pattern);
  background-repeat: repeat;
}

.math-blueprint-bg {
  background-color: #f8fafc;
  background-image:
    var(--bg-math-pattern),
    linear-gradient(to right, rgba(99, 102, 241, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
  background-size: 200px 200px, 24px 24px, 24px 24px;
}

.math-grid-pattern {
  background-image: radial-gradient(rgba(79, 70, 229, 0.12) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
}

.math-hero-backdrop {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
    radial-gradient(circle at 100% 100%, rgba(255, 107, 107, 0.08), transparent 40%),
    var(--bg-math-pattern),
    linear-gradient(to right, rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 200px 200px, 28px 28px, 28px 28px;
  background-color: #ffffff;
}

/* ─── Math Operation Badges & Curriculum Chips ───────────────── */
.math-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.math-badge-add {
  background: #eef2ff;
  color: #4338ca;
  border: 1.5px solid #c7d2fe;
}

.math-badge-sub {
  background: #fff1f2;
  color: #be123c;
  border: 1.5px solid #fecdd3;
}

.math-badge-mul {
  background: #f0fdf4;
  color: #15803d;
  border: 1.5px solid #bbf7d0;
}

.math-badge-div {
  background: #fefce8;
  color: #854d0e;
  border: 1.5px solid #fef08a;
}

.math-badge-count {
  background: #faf5ff;
  color: #7e22ce;
  border: 1.5px solid #e9d5ff;
}

.math-badge-seq {
  background: #ecfeff;
  color: #0e7490;
  border: 1.5px solid #a5f3fc;
}

.math-badge-frac {
  background: #fff7ed;
  color: #c2410c;
  border: 1.5px solid #ffedd5;
}

.grade-pill {
  font-size: 0.7rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

/* ─── Math Feature Cards & Interactive Previews ──────────────── */
.math-feature-card {
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-xl);
  background: #ffffff;
  padding: 24px;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  position: relative;
  overflow: hidden;
}

.math-feature-card:hover {
  border-color: #a5b4fc;
  box-shadow: 0 16px 32px -6px rgba(79, 70, 229, 0.12);
  transform: translateY(-3px);
}

.math-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
  flex-shrink: 0;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-gray-800);
  background-color: #f8fafc;
  background-image: var(--bg-math-pattern);
  background-repeat: repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

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

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-gray-900);
}

/* ─── Utility Classes ────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 640px;
}

.container-md {
  max-width: 768px;
}

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

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-muted {
  color: var(--color-gray-500);
}

.text-primary {
  color: var(--color-primary);
}

.text-success {
  color: var(--color-success);
}

.text-danger {
  color: var(--color-danger);
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-6 {
  margin-bottom: 24px;
}

.mb-8 {
  margin-bottom: 32px;
}

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

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

.justify-between {
  justify-content: space-between;
}

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

.grid {
  display: grid;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

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

/* ─── Buttons (Modern Tactile Math SaaS Buttons) ─────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.25;
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease, background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  letter-spacing: -0.01em;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.45);
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

/* Primary Math Action (Solid Tactile Electric Indigo with 3D Bevel - Zero Gradient) */
.btn-primary {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border: 1.5px solid #4338ca !important;
  box-shadow: 0 4px 0 #312e81, 0 6px 16px rgba(79, 70, 229, 0.28) !important;
  font-weight: 800;
  border-radius: 12px;
}

.btn-primary:hover {
  background: #4338ca !important;
  border-color: #3730a3 !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #1e1b4b, 0 10px 22px rgba(79, 70, 229, 0.38) !important;
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1e1b4b, 0 3px 6px rgba(79, 70, 229, 0.2) !important;
}

.btn-primary-lg {
  padding: 13px 30px;
  font-size: 1.05rem;
  border-radius: 14px;
}

/* Outline Button with Tactile Chalk/Slate Depth */
.btn-outline {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #1e293b;
  box-shadow: 0 3px 0 #94a3b8, 0 2px 5px rgba(15, 23, 42, 0.05);
  font-weight: 800;
}

.btn-outline:hover {
  border-color: #6366f1;
  color: #4338ca;
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #4f46e5, 0 6px 14px rgba(99, 102, 241, 0.16);
}

.btn-outline:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #4f46e5;
}

/* Outline on Dark / Colored Backdrops */
.btn-outline-white {
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.65);
  color: #ffffff !important;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 3px 0 rgba(255, 255, 255, 0.35);
  font-weight: 800;
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #ffffff;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(255, 255, 255, 0.5), 0 8px 18px rgba(0, 0, 0, 0.2);
}

.btn-outline-white:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* White High-Contrast Button (For dark bands like pg-footer-cta) */
.btn-white {
  background: #ffffff !important;
  color: #1e1b4b !important;
  border: 2px solid #ffffff !important;
  font-weight: 900 !important;
  border-radius: 12px;
  box-shadow: 0 4px 0 #cbd5e1, 0 8px 20px rgba(0, 0, 0, 0.16) !important;
}

.btn-white:hover {
  background: #f8fafc !important;
  color: #312e81 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #94a3b8, 0 12px 24px rgba(0, 0, 0, 0.22) !important;
}

.btn-white:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #94a3b8 !important;
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  border: 1.5px solid transparent;
  color: var(--color-gray-600);
  border-radius: 12px;
  font-weight: 700;
}

.btn-ghost:hover {
  background: #eef2ff;
  border-color: #e0e7ff;
  color: #4338ca;
  transform: translateY(-1px);
}

.btn-ghost:active {
  transform: translateY(1px);
}

/* Danger Button (Tactile Coral Red) */
.btn-danger {
  background: #ef4444;
  color: #ffffff;
  border: 1.5px solid #dc2626;
  border-radius: 12px;
  box-shadow: 0 4px 0 #b91c1c, 0 6px 14px rgba(239, 68, 68, 0.25);
  font-weight: 800;
}

.btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #991b1b, 0 8px 18px rgba(239, 68, 68, 0.35);
}

.btn-danger:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #991b1b;
}

/* Size Variants */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
  border-radius: 9px;
  box-shadow: 0 3px 0 #3730a3;
}

.btn-sm.btn-outline {
  box-shadow: 0 2.5px 0 #94a3b8;
}

.btn-sm:hover {
  transform: translateY(-1.5px);
}

.btn-sm:active {
  transform: translateY(1.5px);
  box-shadow: 0 1px 0 #3730a3;
}

.btn-sm.btn-outline:active {
  box-shadow: 0 1px 0 #94a3b8;
}

.btn-lg {
  padding: 13px 30px;
  font-size: 1.05rem;
  border-radius: 14px;
  box-shadow: 0 5px 0 #3730a3, 0 8px 20px rgba(79, 70, 229, 0.3);
}

.btn-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #312e81, 0 12px 26px rgba(79, 70, 229, 0.38);
}

.btn-lg:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #312e81;
}

.btn-icon {
  padding: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.btn-icon-sm {
  padding: 6px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

/* Tactile Math Action Button (Solid High-Contrast Kids Math Action - Zero Gradient) */
.btn-gradient {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border: 1.5px solid #4338ca !important;
  box-shadow: 0 4px 0 #312e81, 0 8px 18px rgba(79, 70, 229, 0.28) !important;
  font-weight: 800;
  border-radius: 12px;
}

.btn-gradient:hover {
  background: #4338ca !important;
  border-color: #3730a3 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #1e1b4b, 0 12px 24px rgba(79, 70, 229, 0.38) !important;
  color: #ffffff !important;
}

.btn-gradient:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1e1b4b, 0 4px 8px rgba(79, 70, 229, 0.2) !important;
}

/* ─── Form Elements ──────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gray-700);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--color-gray-800);
  background: #fff;
  border: 1.5px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  outline: none;
}

.form-input::placeholder {
  color: var(--color-gray-400);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.12);
}

.form-input.is-invalid,
.form-select.is-invalid {
  border-color: var(--color-danger);
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--color-gray-500);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--color-danger);
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card-body {
  padding: 24px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-gray-100);
  background: var(--color-gray-50);
}

.card-hover {
  cursor: pointer;
}

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

/* ─── Alerts / Flash Messages ────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

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

.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ─── Tables & Data Grids ────────────────────────────────────── */
.table-wrap,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-200);
  background: #ffffff;
}

.table-wrap table,
.table-responsive table,
table.table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  text-align: left;
}

.table-wrap th,
.table-responsive th,
table.table th {
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-500);
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
  white-space: nowrap;
}

.table-wrap td,
.table-responsive td,
table.table td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-100);
  vertical-align: middle;
}

.table-wrap tr:last-child td,
.table-responsive tr:last-child td,
table.table tr:last-child td {
  border-bottom: none;
}

.table-wrap tr:hover td,
.table-responsive tr:hover td,
table.table tr:hover td {
  background: var(--color-gray-50);
}

/* ─── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.5;
}

.badge-primary {
  background: var(--color-primary-100);
  color: var(--color-primary-dark);
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-neutral {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
}

/* ─── Public Navbar ──────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  height: 64px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.navbar-brand-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--color-gray-900);
}

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

.navbar-nav a {
  padding: 8px 14px;
  color: var(--color-gray-600);
  font-weight: 500;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.navbar-nav a:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-900);
}

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

/* ─── Navbar Dropdown ("More") ───────────────────────────────── */
.navbar-dropdown {
  position: relative;
}

.navbar-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-600);
  font-weight: 500;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-family: inherit;
  line-height: 1;
}

.navbar-dropdown-trigger:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-900);
}

.navbar-chevron {
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.navbar-dropdown.open > .navbar-dropdown-trigger {
  background: var(--color-gray-100);
  color: var(--color-gray-900);
}

.navbar-dropdown.open > .navbar-dropdown-trigger .navbar-chevron {
  transform: rotate(180deg);
}

.navbar-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
  list-style: none;
  padding: 6px;
  z-index: 200;
  animation: dropdown-in 0.14s ease;
}

.navbar-dropdown.open > .navbar-dropdown-menu {
  display: block;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.navbar-dropdown-menu a {
  display: block;
  padding: 9px 14px;
  color: var(--color-gray-700);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.navbar-dropdown-menu a:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-900);
}

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--gradient-dark);
  color: var(--color-gray-400);
  padding: 64px 0 32px;
  margin-top: 0;
}

.footer a {
  color: var(--color-gray-400);
}

.footer a:hover {
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.footer-tagline {
  font-size: 0.875rem;
  margin-top: 8px;
  line-height: 1.5;
}

.footer-heading {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

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

.footer-links a {
  font-size: 0.9rem;
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-gray-800);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

/* ─── Hero Section ───────────────────────────────────────────── */
.hero {
  padding: 80px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgb(99 102 241 / 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--color-primary-50);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-primary-100);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--color-gray-900);
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-title .gradient {
  color: var(--color-primary);
  -webkit-text-fill-color: var(--color-primary);
  background: none;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--color-gray-600);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* ─── Section Layout ─────────────────────────────────────────── */
section[id],
.section[id],
.pg-section[id] {
  scroll-margin-top: 80px;
}

.section {
  padding: 80px 0;
}

.section-sm {
  padding: 48px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--color-gray-600);
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Feature Grid ───────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  padding: 28px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  background: #fff;
  transition: all var(--transition-slow);
}

.feature-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: 0 8px 24px rgb(99 102 241 / 0.08);
  transform: translateY(-3px);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.feature-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--color-gray-600);
  line-height: 1.6;
}

/* ─── Pricing Cards ──────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  max-width: 960px;
  margin: 0 auto;
  align-items: start;
}

.pricing-card {
  background: #fff;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-2xl);
  padding: 36px 30px;
  position: relative;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-primary-light);
}

.pricing-card.featured {
  border-color: var(--color-primary);
  box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.22), 0 0 0 3px rgba(99, 102, 241, 0.15);
  transform: translateY(-4px);
}

.pricing-popular {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 18px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.4);
}

.pricing-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-gray-900);
}

.pricing-price {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--color-gray-900);
  margin: 12px 0;
}

.pricing-price sup {
  font-size: 1rem;
  font-weight: 600;
  vertical-align: super;
}

.pricing-price span {
  font-size: 1rem;
  color: var(--color-gray-500);
  font-weight: 400;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--color-gray-700);
}

.pricing-features li .check {
  color: var(--color-success);
  font-size: 1rem;
}

/* ─── Sidebar Layout (Dashboard) ────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: #f8fafc;
  background-image: var(--bg-math-pattern);
  background-repeat: repeat;
}

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid var(--color-gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-gray-100);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-gray-900);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.sidebar-nav-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gray-400);
  padding: 12px 10px 6px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-gray-600);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}

.sidebar-nav-item:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-900);
}

.sidebar-nav-item.active {
  background: var(--color-primary-50);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.sidebar-nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-nav-item .nav-badge {
  display: none !important;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--color-gray-100);
}

/* ─── Sidebar Mobile Backdrop ────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

/* ─── App Topbar ─────────────────────────────────────────────── */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--color-gray-700);
  cursor: pointer;
  padding: 8px;
  margin-right: 12px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.mobile-menu-toggle:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-900);
}

.app-topbar-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: inline-flex !important;
  }

  .app-main {
    margin-left: 0 !important;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: fixed !important;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
  }

  .sidebar.show {
    transform: translateX(0) !important;
  }
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
}

/* ─── App Content Area ───────────────────────────────────────── */
.app-content {
  padding: 28px;
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px) {
  .app-content {
    padding: 18px 14px;
  }

  .app-topbar {
    padding: 0 14px;
  }

  .app-topbar-title {
    font-size: 1rem;
    max-width: 170px;
  }
}

/* ─── Dashboard Stats ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-gray-900);
  margin: 4px 0;
  line-height: 1;
}

.stat-sub {
  font-size: 0.8125rem;
  color: var(--color-gray-500);
}

/* ─── Progress Bar ───────────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--color-gray-100);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, #8b5cf6 100%);
  border-radius: 99px;
  transition: width 0.6s ease;
}

.progress-bar.warning {
  background: var(--color-warning);
}

.progress-bar.danger {
  background: var(--color-danger);
}

/* ─── Book Card ──────────────────────────────────────────────── */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.book-card {
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  /* Removed overflow: hidden so dropdown menus don't get clipped */
  transition: all var(--transition-base);
  cursor: pointer;
}

.book-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--color-primary-light);
}

.book-cover {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-primary-100) 100%);
  border-top-left-radius: calc(var(--radius-lg) - 1px);
  border-top-right-radius: calc(var(--radius-lg) - 1px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.book-info {
  padding: 14px;
}

.book-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-gray-800);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-meta {
  font-size: 0.8125rem;
  color: var(--color-gray-500);
}

/* ─── Page Sections BG ───────────────────────────────────────── */
.bg-white {
  background: #fff;
}

.bg-gray {
  background: var(--color-gray-50);
}

.bg-dark {
  background: var(--color-gray-900);
}

.bg-gradient {
  background: linear-gradient(135deg, var(--color-primary-50) 0%, #ede9fe 100%);
}

/* ─── Step / How it works ────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}

.step-card {
  text-align: center;
  padding: 28px 20px;
}

.step-number {
  width: 52px;
  height: 52px;
  background: #4f46e5;
  color: #fff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 auto 16px;
  box-shadow: 0 4px 0 #312e81;
}

.step-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-desc {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

/* ─── Dropdown Menu ──────────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 200px;
  padding: 6px;
  z-index: 200;
  display: none;
  animation: dropFadeIn 0.15s ease;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 0.9rem;
  color: var(--color-gray-700);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-900);
}

.dropdown-divider {
  border-top: 1px solid var(--color-gray-100);
  margin: 6px 0;
}

/* ─── Table ──────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

thead th {
  background: var(--color-gray-50);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-gray-500);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-gray-200);
}

tbody td {
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-100);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--color-gray-50);
}

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.page-btn {
  padding: 7px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-gray-700);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

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

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-desc {
  color: var(--color-gray-500);
  margin-bottom: 24px;
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dropFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

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

  to {
    transform: rotate(360deg);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease both;
}

.animate-slideUp {
  animation: slideUp 0.4s ease both;
}

.spinner {
  animation: spin 0.8s linear infinite;
}

/* ─── Auth Pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f0ff 0%, #fff 50%, #fdf4ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  text-decoration: none;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  color: var(--color-gray-500);
  font-size: 0.9375rem;
  margin-bottom: 32px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-gray-400);
  font-size: 0.875rem;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-gray-200);
}

.auth-footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-gray-600);
  margin-top: 24px;
}

/* ─── Usage bar in sidebar ───────────────────────────────────── */
.usage-item {
  margin-bottom: 12px;
}

.usage-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-gray-600);
  margin-bottom: 4px;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }

  .sidebar.show {
    display: flex !important;
    box-shadow: var(--shadow-lg);
  }

  .mobile-menu-toggle {
    display: inline-flex !important;
  }

  .app-main {
    margin-left: 0;
  }

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

@media (max-width: 768px) {

  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Navbar */
  .navbar-inner {
    height: 60px;
    padding: 0;
  }

  .navbar-nav {
    display: none;
  }

  .navbar-brand-name {
    font-size: 1.125rem;
  }

  .navbar-brand-logo {
    max-height: 32px;
  }

  .navbar-actions .btn {
    padding: 6px 12px;
    font-size: 0.8125rem;
  }

  /* Hero */
  .hero {
    padding: 36px 0 24px;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 4px 12px;
  }

  .hero-title {
    font-size: clamp(1.85rem, 6.5vw, 2.5rem);
    line-height: 1.18;
    letter-spacing: -0.02em;
    word-break: break-word;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    line-height: 1.55;
    padding: 0 4px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
    margin: 20px auto 0;
    gap: 10px;
  }

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

  .hero-trust-list {
    gap: 8px 14px;
    font-size: 0.78rem;
    margin-top: 16px;
  }

  /* Hero Board */
  .hero-visual-board {
    padding: 16px 12px;
    margin-top: 24px;
    border-radius: 16px;
  }

  .mockup-flow-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mockup-flow-arrow {
    transform: rotate(90deg);
    padding: 4px 0;
    font-size: 1.25rem;
  }

  /* Sections */
  .section {
    padding: 48px 0;
  }

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

  .section-title {
    font-size: 1.625rem;
    line-height: 1.25;
  }

  .section-subtitle {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  /* Grids & Cards */
  .audience-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .audience-pill {
    padding: 14px;
  }

  .commercial-split {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .etsy-bundle-box,
  .kdp-specs-box {
    padding: 16px;
    border-radius: 16px;
  }

  .compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-radius: 12px;
  }

  .compare-table {
    min-width: 540px;
  }

  /* Pricing */
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 340px;
    margin: 0 auto;
    gap: 20px;
  }

  /* FAQ */
  .faq-btn {
    padding: 14px 16px;
    font-size: 0.9375rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .app-content {
    padding: 16px;
  }

  .auth-card {
    padding: 24px 16px;
    border-radius: 16px;
  }
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* ─── Tooltip ────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-gray-900);
  color: #fff;
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ─── Landing Page Overhaul Styles ───────────────────────────── */
.hero-trust-list {
  display: flex;
  gap: 12px 22px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
}

.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: -0.01em;
}

.hero-trust-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.32);
  flex-shrink: 0;
}

.hero-trust-check svg {
  display: block;
  width: 11px;
  height: 11px;
  stroke: #ffffff;
}

/* Hero Visual Product Mockup */
.hero-visual-board {
  margin-top: 40px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(243, 244, 246, 0.7) 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-2xl);
  padding: 32px 24px;
  box-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.05);
  position: relative;
}

.mockup-flow-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.15fr;
  align-items: center;
  gap: 16px;
}

.mockup-sheet-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  position: relative;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  text-align: left;
}

.mockup-sheet-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.15);
  border-color: var(--color-primary-light);
}

.mockup-sheet-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 8px;
}

.mockup-book-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 15px 35px -5px rgba(30, 27, 75, 0.35);
  text-align: left;
  border: 2px solid #4338ca;
  position: relative;
}

.mockup-flow-arrow {
  font-size: 1.5rem;
  color: var(--color-primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Real Product Demo Responsive Classes ─────────────────────── */
.product-demo-card {
  padding: 32px;
  background: #ffffff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-gray-200);
  max-width: 960px;
  margin: 0 auto;
}

.demo-steps-indicator-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-gray-200);
  padding-bottom: 16px;
}

.demo-step-badge {
  padding: 8px 12px;
  border-radius: 8px;
}

.product-demo-split-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
  align-items: center;
}

.demo-settings-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.demo-preview-sheet {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.demo-sheet-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 6px;
}

/* ─── Teachers & Parents Responsive Classes ────────────────────── */
.teacher-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  border-radius: var(--radius-2xl);
  padding: 40px 32px;
}

.teacher-split-grid,
.parents-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 900px) {
  .product-demo-card {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .demo-steps-indicator-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 12px;
  }

  .product-demo-split-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .teacher-box {
    padding: 24px 16px;
    border-radius: 18px;
  }

  .teacher-split-grid,
  .parents-split-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .demo-steps-indicator-grid {
    grid-template-columns: 1fr;
  }

  .product-demo-card {
    padding: 16px 12px;
  }

  .demo-settings-panel,
  .demo-preview-sheet {
    padding: 14px 12px;
  }
}

/* Audience Grid */
.audience-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.audience-pill {
  background: #ffffff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.audience-pill:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Commercial Showcase Cards */
.commercial-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.etsy-bundle-box {
  background: #ffffff;
  border: 2px dashed #f97316;
  border-radius: var(--radius-xl);
  padding: 24px;
  background: #fffaf5;
}

.kdp-specs-box {
  background: #ffffff;
  border: 2px solid #6366f1;
  border-radius: var(--radius-xl);
  padding: 24px;
  background: #f8faff;
}

/* Comparison Table */
.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-200);
  background: #ffffff;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.compare-table th {
  padding: 16px 20px;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-gray-200);
}

.compare-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-gray-100);
  font-size: 0.9375rem;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-table tr:hover td {
  background: var(--color-gray-50);
}

/* Examples Gallery */
.examples-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.example-sheet-item {
  background: #ffffff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.example-sheet-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}

@media (max-width: 900px) {
  .mockup-flow-grid {
    grid-template-columns: 1fr;
  }

  .mockup-flow-arrow {
    transform: rotate(90deg);
    padding: 8px 0;
  }

  .commercial-split {
    grid-template-columns: 1fr;
  }
}

/* ─── Video Demo Facade Styles ───────────────────────────────── */
.video-demo-box {
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f172a;
}

.video-facade-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  cursor: pointer;
  background: #090d16;
  overflow: hidden;
}

.video-facade-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
  opacity: 1;
}

.video-facade-wrap:hover .video-facade-thumb {
  transform: scale(1.03);
}

.video-play-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.video-play-btn-circle {
  width: 76px;
  height: 76px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: playPulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
  transition: transform var(--transition-fast);
}

.video-facade-wrap:hover .video-play-btn-circle {
  transform: scale(1.12);
  background: #ff0000;
}

@keyframes playPulse {
  to {
    box-shadow: 0 0 0 24px rgba(239, 68, 68, 0);
  }
}

.video-play-label {
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 14px;
  border-radius: 99px;
  backdrop-filter: blur(4px);
}

/* ─── Scroll Fade-In Animations (Always Visible Safety Failsafe) ── */
.fade-section {
  opacity: 1 !important;
  transform: none !important;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-section.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* ─── Filter Chips (Math Category Filters) ─────────────────────── */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--color-gray-700);
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 2px 0 #cbd5e1;
  user-select: none;
}

.filter-chip:hover {
  color: var(--color-primary-deep);
  border-color: var(--color-primary-light);
  background: var(--color-primary-50);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #818cf8;
}

.filter-chip.active {
  color: #ffffff !important;
  background: #4f46e5 !important;
  border-color: #4338ca !important;
  box-shadow: 0 3px 0 #312e81, 0 6px 14px rgba(79, 70, 229, 0.25) !important;
  transform: translateY(-1px);
  border-radius: 12px !important;
}

.filter-chip:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #312e81 !important;
}

/* ─── Multi-Item Stage Activity Carousel (Cover Flow) ────────── */
.activity-stage-carousel-wrapper {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  padding: 20px 0;
  overflow: hidden;
}

.activity-stage-carousel-container,
.activity-stage-container {
  position: relative;
  overflow: visible;
  width: 100%;
  padding: 20px 0;
}

.activity-stage-carousel-track,
.activity-carousel-track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  align-items: center;
}

.activity-carousel-slide {
  flex: 0 0 360px;
  width: 360px;
  box-sizing: border-box;
  padding: 8px 12px;
  opacity: 0.45;
  transform: scale(0.88) translateY(12px);
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease, box-shadow 0.5s ease;
  cursor: pointer;
}

.activity-carousel-slide.is-adjacent {
  opacity: 0.72;
  transform: scale(0.93) translateY(6px);
}

.activity-carousel-slide.is-active {
  opacity: 1;
  transform: scale(1.04) translateY(0);
  z-index: 10;
  cursor: default;
}

@media (max-width: 768px) {
  .activity-stage-carousel-wrapper {
    padding: 10px 0;
  }

  .activity-stage-carousel-container {
    padding: 10px 0;
  }

  .activity-carousel-slide {
    flex: 0 0 calc(100vw - 44px);
    max-width: 320px;
    padding: 4px 6px;
    opacity: 0.35;
    transform: scale(0.9) translateY(8px);
  }

  .activity-carousel-slide.is-adjacent {
    opacity: 0.65;
    transform: scale(0.94) translateY(4px);
  }

  .activity-carousel-slide.is-active {
    opacity: 1;
    transform: scale(1.02) translateY(0);
  }

  .activity-slide-card {
    padding: 14px 14px 12px;
    border-radius: 14px;
  }

  .carousel-btn {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .carousel-btn.prev {
    left: 4px;
  }

  .carousel-btn.next {
    right: 4px;
  }

  .filter-chip {
    padding: 6px 12px;
    font-size: 0.78rem;
  }
}

.activity-slide-card {
  background: #ffffff;
  border: 1px solid var(--color-gray-200);
  border-radius: 18px;
  padding: 20px 20px 16px 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.activity-carousel-slide.is-active .activity-slide-card {
  box-shadow: 0 20px 45px -10px rgba(99, 102, 241, 0.18), 0 0 0 1.5px rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.3);
}

.activity-page-frame {
  width: 100%;
  aspect-ratio: 8.5 / 11;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.06);
  margin: 12px 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-page-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid var(--color-gray-300);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--color-gray-800);
  cursor: pointer;
  z-index: 20;
  transition: all var(--transition-fast);
}

.carousel-btn:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4338ca;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

.carousel-btn.prev {
  left: 12px;
}

.carousel-btn.next {
  right: 12px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gray-300);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.carousel-dot.active {
  width: 24px;
  border-radius: 12px;
  background: #4f46e5;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

/* ─── Print Styles ───────────────────────────────────────────── */
@media print {

  .navbar,
  .sidebar,
  .app-topbar,
  .footer {
    display: none !important;
  }

  .app-main {
    margin-left: 0;
  }

  body {
    background: white;
  }
}

/* ============================================================
   Public Redesign Layout Primitives (.pg-*)
   Layout only — uses existing design tokens
   ============================================================ */

/* Header: brand | centered nav | actions */
.navbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
}

.navbar-actions {
  justify-self: end;
}

.pg-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-gray-200);
  background: #fff;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pg-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-gray-800);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.pg-nav-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.pg-nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.pg-nav-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.pg-nav-drawer {
  display: none;
}

@media (max-width: 768px) {
  .navbar {
    height: auto;
  }

  .navbar-inner {
    display: flex;
    height: 60px;
    padding: 0 16px;
  }

  .pg-nav-toggle {
    display: inline-flex;
  }

  .pg-hide-mobile {
    display: none !important;
  }

  .pg-nav-drawer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    padding: 0 16px;
    background: #fff;
    border-top: 1px solid transparent;
    transition: max-height var(--transition-slow), padding var(--transition-slow);
  }

  .pg-nav-drawer.open {
    max-height: 420px;
    padding: 10px 16px 16px;
    border-top-color: var(--color-gray-200);
  }

  .pg-nav-drawer a {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--color-gray-700);
    font-weight: 600;
  }

  .pg-nav-drawer a:hover {
    background: var(--color-gray-100);
  }
}

/* Footer CTA band - Solid Dark Math Blueprint with High-Contrast Action */
.pg-footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 32px 36px;
  margin-bottom: 48px;
  border-radius: var(--radius-2xl);
  background: #1e1b4b !important;
  border: 2px solid #4338ca;
  background-image: radial-gradient(rgba(99, 102, 241, 0.18) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  box-shadow: 0 16px 36px -8px rgba(30, 27, 75, 0.45);
}

.pg-footer-cta-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.pg-footer-cta-sub {
  color: #c7d2fe;
  font-size: 0.95rem;
  margin-top: 4px;
  font-weight: 600;
  opacity: 0.95;
}

.pg-footer-cta .btn,
.pg-footer-cta .btn-gradient,
.pg-footer-cta .btn-white,
.pg-footer-cta a.btn,
.pg-footer-cta a {
  background: #ffffff !important;
  color: #1e1b4b !important;
  border: 2px solid #ffffff !important;
  font-weight: 900 !important;
  font-size: 1rem !important;
  padding: 13px 28px !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 0 #cbd5e1, 0 8px 20px rgba(0, 0, 0, 0.22) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease !important;
}

.pg-footer-cta .btn:hover,
.pg-footer-cta .btn-gradient:hover,
.pg-footer-cta .btn-white:hover,
.pg-footer-cta a.btn:hover,
.pg-footer-cta a:hover {
  background: #f8fafc !important;
  color: #312e81 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 0 #94a3b8, 0 12px 24px rgba(0, 0, 0, 0.28) !important;
}

.pg-footer-cta .btn:active,
.pg-footer-cta .btn-gradient:active,
.pg-footer-cta .btn-white:active,
.pg-footer-cta a.btn:active,
.pg-footer-cta a:active {
  transform: translateY(2px) !important;
  box-shadow: 0 2px 0 #94a3b8 !important;
}

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

/* Section primitives */
.pg-section {
  padding: 76px 0;
}

.pg-section-alt {
  background: #fff;
  border-top: 1px solid var(--color-gray-200);
  border-bottom: 1px solid var(--color-gray-200);
}

.pg-head {
  max-width: 680px;
  margin: 0 auto 44px;
  text-align: center;
}

.pg-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pg-head p {
  color: var(--color-gray-600);
  margin-top: 10px;
  font-size: 1.05rem;
}

.pg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-deep);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(236, 72, 153, 0.12) 100%);
  border: 1px solid rgba(99, 102, 241, 0.20);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}

/* Split hero */
.pg-hero {
  padding: 68px 0 60px;
  background: var(--gradient-hero), var(--color-canvas);
}

.pg-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.pg-hero-copy h1 {
  font-size: clamp(2.35rem, 4.4vw, 3.65rem);
  font-weight: 900;
  line-height: 1.12;
  margin: 0 0 18px;
  letter-spacing: -0.025em;
}

.pg-hero-copy p {
  font-size: 1.15rem;
  color: var(--color-gray-600);
  max-width: 560px;
  margin-bottom: 26px;
  line-height: 1.6;
}

.pg-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.pg-hero-visual {
  position: relative;
  min-height: 460px;
}

.pg-hero-sheet {
  position: absolute;
  width: 56%;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 35px -10px rgba(99, 102, 241, 0.15), 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 12px;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.pg-hero-sheet:hover {
  transform: translateY(-8px) rotate(0deg) !important;
  box-shadow: 0 25px 45px -10px rgba(99, 102, 241, 0.25);
  z-index: 5;
}

.pg-hero-sheet-a {
  left: 0;
  top: 24px;
  transform: rotate(-4deg);
}

.pg-hero-sheet-b {
  right: 0;
  top: 0;
  transform: rotate(3deg);
}

.pg-hero-sheet img {
  width: 100%;
  aspect-ratio: 8.5/11;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-md);
}

.pg-hero-sheet .mockup-sheet-tag {
  margin-bottom: 8px;
  font-weight: 800;
  border-radius: 99px;
}

.pg-hero-book {
  position: absolute;
  left: 20%;
  bottom: 0;
  width: 64%;
  z-index: 3;
}

.pg-hero-book .mockup-book-card {
  box-shadow: 0 25px 50px -12px rgba(30, 27, 75, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Strip */
.pg-strip {
  padding: 26px 0;
  background: #ffffff;
  border-top: 1px solid var(--color-gray-200);
  border-bottom: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-xs);
}

.pg-strip-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px 32px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-gray-600);
}

/* Two-column feature row */
.pg-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.pg-row.reverse> :first-child {
  order: 2;
}

/* Tabs (Audience Segmented Controls) */
.pg-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.pg-tab {
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: var(--color-gray-700);
  font: inherit;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  padding: 10px 22px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 0 #cbd5e1;
}

.pg-tab:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary-deep);
  background: var(--color-primary-50);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #818cf8;
}

.pg-tab.active {
  background: #4f46e5 !important;
  border-color: #4338ca !important;
  color: #ffffff !important;
  box-shadow: 0 3px 0 #312e81, 0 6px 14px rgba(79, 70, 229, 0.28) !important;
  transform: translateY(-1px);
  border-radius: 12px !important;
}

.pg-tab:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #312e81 !important;
}

.pg-tab-panel {
  display: none;
}

.pg-tab-panel.active {
  display: block;
}

.pg-tab-panel>section {
  padding-top: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

/* FAQ two-column */
.pg-faq-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr;
  gap: 56px;
  align-items: start;
}

.pg-faq-grid .pg-head {
  text-align: left;
  margin: 0;
  position: sticky;
  top: 92px;
}

/* Final CTA band */
.pg-cta-band {
  border-radius: var(--radius-2xl);
  background: var(--gradient-dark);
}

@media (max-width: 960px) {

  .pg-hero-grid,
  .pg-row,
  .pg-faq-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .pg-row.reverse> :first-child {
    order: 0;
  }

  .pg-hero-visual {
    min-height: 400px;
    max-width: 460px;
    margin: 0 auto;
    width: 100%;
  }

  .pg-faq-grid .pg-head {
    position: static;
  }

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

@media (max-width: 600px) {
  .pg-section {
    padding: 48px 0;
  }

  .pg-footer-cta {
    padding: 22px 20px;
  }

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

  .pg-hero-visual {
    min-height: 340px;
  }
}

/* Feature grid: Balanced 2x2 on desktop, 1-column on mobile */
.pg-bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.pg-bento>.card {
  display: flex !important;
  flex-direction: column !important;
  padding: 32px;
  background: #ffffff;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.pg-bento>.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-primary-light);
}

@media (max-width: 860px) {
  .pg-bento {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}