/*
 * AnySignal Design System
 * Unified CSS framework — marketing pages + application UI
 *
 * Rounded panels by default. Add .sharp to any element/container for angular edges.
 *
 * Table of Contents:
 *   1. Fonts
 *   2. Design Tokens (CSS variables)
 *   3. Reset & Base
 *   4. Scrollbars & Selection
 *   5. Typography Scale
 *   6. Navigation
 *   7. Hero Section
 *   8. Sections & Layout
 *   9. Buttons
 *  10. Bordered Grid System (marketing)
 *  11. Card Systems
 *  12. Status Badges & Tags
 *  13. Stats Grid
 *  14. Forms & Inputs
 *  15. Tables
 *  16. Modals & Dialogs
 *  17. Alerts & Notifications
 *  18. Tooltips
 *  19. Wizard & Stepper
 *  20. Sidebar Navigation
 *  21. Panels & Sections
 *  22. Pagination
 *  23. Tabs
 *  24. Toggle Switches
 *  25. Entity Badges & Tags
 *  26. Validation & Feedback
 *  27. Loading States & Animations
 *  28. Image & Gallery Grids
 *  29. Pricing
 *  30. Globe & Visualization
 *  31. CTA Section
 *  32. Footer
 *  33. Dither Effect
 *  34. Utilities
 *  35. Theme: Day Mode (component overrides)
 *  36. Responsive
 */


/* ══════════════════════════════════════════════════════════════════
   1. FONTS
   ══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

@font-face {
  font-family: 'Neue Montreal';
  src: url('https://cdn.prod.website-files.com/69bb4499c4f88fedfbd57a86/69bb4499c4f88fedfbd57a8b_PPNEUEMONTREAL-THIN.OTF') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Montreal';
  src: url('https://cdn.prod.website-files.com/69bb4499c4f88fedfbd57a86/69bb4499c4f88fedfbd57a8c_PPNeueMontreal-Book.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Montreal';
  src: url('https://cdn.prod.website-files.com/69bb4499c4f88fedfbd57a86/69bb4499c4f88fedfbd57a8d_PPNeueMontreal-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Montreal';
  src: url('https://cdn.prod.website-files.com/69bb4499c4f88fedfbd57a86/69bb4499c4f88fedfbd57a8e_PPNeueMontreal-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ══════════════════════════════════════════════════════════════════
   2. DESIGN TOKENS
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* ── Color Palette ── */
  --bg-primary:     #15181F;
  --bg-secondary:   #1F2535;
  --bg-card:        #242b3d;
  --bg-card-hover:  #2a3349;
  --bg-surface:     #1e2433;
  --bg-elevated:    #252b3d;

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted:     #94a3b8;
  --text-dim:       #5f6368;

  /* Accent */
  --accent:         #22BB83;
  --accent-hover:   #2ed69a;
  --accent-dim:     rgba(34, 187, 131, 0.15);
  --accent-glow:    rgba(34, 187, 131, 0.3);

  /* Semantic */
  --color-success:  #22BB83;
  --color-warning:  #edc355;
  --color-danger:   #e65757;
  --color-info:     #3b82f6;
  --color-purple:   #a279c9;

  --success-dim:    rgba(34, 187, 131, 0.15);
  --warning-dim:    rgba(237, 195, 85, 0.15);
  --danger-dim:     rgba(230, 87, 87, 0.15);
  --info-dim:       rgba(59, 130, 246, 0.15);
  --purple-dim:     rgba(162, 121, 201, 0.15);

  /* Borders */
  --border:         rgba(255, 255, 255, 0.25);
  --border-hover:   rgba(255, 255, 255, 0.4);
  --border-subtle:  rgba(255, 255, 255, 0.1);

  /* Shadows & Glows */
  --glow-sm:        0 0 8px var(--accent-glow);
  --glow-md:        0 0 20px var(--accent-glow);
  --glow-lg:        0 0 30px var(--accent-glow);
  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md:      0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:      0 8px 24px rgba(0, 0, 0, 0.5);

  /* Typography */
  --font-sans:      'Neue Montreal', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:      'JetBrains Mono', monospace;

  /* Sizing */
  --radius-sm:      2px;
  --radius-md:      4px;
  --radius-lg:      8px;
  --radius-full:    9999px;

  /* Panel radius — rounded by default, use .sharp for angular */
  --panel-radius:   var(--radius-lg);
  --panel-border:   1px solid var(--border);
}

/* Per-element / per-container overrides */
.sharp   { --panel-radius: 0px; }
.rounded { --panel-radius: var(--radius-lg); }

/* ── Day Mode overrides ── */
/* Use html.light-mode so variables override at the same level as :root */
html.light-mode {
  --bg-primary:     #d7d7d3;
  --bg-secondary:   #cdcdca;
  --bg-card:        #e2e2de;
  --bg-card-hover:  #e9e9e5;
  --bg-surface:     #dbdbd8;
  --bg-elevated:    #e7e7e3;

  --text-primary:   #1a1d1f;
  --text-secondary: #33373b;
  --text-muted:     #5c6370;
  --text-dim:       #8c939e;

  --accent:         #2a7d5e;
  --accent-hover:   #1f6a4e;
  --accent-dim:     rgba(42, 125, 94, 0.12);
  --accent-glow:    rgba(42, 125, 94, 0.20);

  --color-success:  #2a7d5e;
  --color-warning:  #97691a;
  --color-danger:   #ac3535;
  --color-info:     #3460be;
  --color-purple:   #6d3fb8;

  --success-dim:    rgba(42, 125, 94, 0.10);
  --warning-dim:    rgba(151, 105, 26, 0.10);
  --danger-dim:     rgba(172, 53, 53, 0.10);
  --info-dim:       rgba(52, 96, 190, 0.10);
  --purple-dim:     rgba(109, 63, 184, 0.10);

  --border:         rgba(0, 0, 0, 0.30);
  --border-hover:   rgba(0, 0, 0, 0.45);
  --border-subtle:  rgba(0, 0, 0, 0.20);

  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md:      0 4px 12px rgba(0, 0, 0, 0.10);
  --shadow-lg:      0 8px 24px rgba(0, 0, 0, 0.12);
}


/* ══════════════════════════════════════════════════════════════════
   3. RESET & BASE
   ══════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}


/* ══════════════════════════════════════════════════════════════════
   4. SCROLLBARS & SELECTION
   ══════════════════════════════════════════════════════════════════ */

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

::-moz-selection {
  background: var(--accent);
  color: var(--bg-primary);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--text-dim) var(--bg-secondary);
}

*::-webkit-scrollbar       { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--bg-secondary); }
*::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: var(--radius-md); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* ══════════════════════════════════════════════════════════════════
   5. TYPOGRAPHY SCALE
   ══════════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.8rem); letter-spacing: -0.028em; line-height: 1.08; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); letter-spacing: -0.028em; line-height: 1.1; }
h3 { font-size: 1.35rem; font-weight: 500; }
h4 { font-size: 1.1rem; font-weight: 500; }
h5 { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
h6 { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }

p { font-size: 0.95rem; line-height: 1.65; color: var(--text-secondary); }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

code {
  padding: 0.15em 0.4em;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

pre {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  color: var(--text-secondary);
}

pre code {
  padding: 0;
  background: none;
  color: inherit;
}

/* Monospace label — reusable pattern */
.label, .overline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: block;
}

.label-muted {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
}


/* ══════════════════════════════════════════════════════════════════
   6. NAVIGATION
   ══════════════════════════════════════════════════════════════════ */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  padding: 0 3rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(21, 24, 31, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-logo svg { height: 22px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--accent); }

.nav-cta {
  padding: 0.55rem 1.5rem;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s;
}

.nav-cta:hover {
  background: var(--accent-hover);
  box-shadow: var(--glow-lg);
  color: var(--bg-primary);
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  z-index: 110;
}

.nav-toggle svg { width: 24px; height: 24px; }

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 105;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu.active { transform: translateX(0); }

.mobile-menu a {
  font-size: 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.mobile-menu .nav-cta {
  font-size: 1rem;
  padding: 1rem 3rem;
  margin-top: 1rem;
}


/* ══════════════════════════════════════════════════════════════════
   7. HERO SECTION
   ══════════════════════════════════════════════════════════════════ */

.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 10rem 5rem 5rem;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}

.hero-overline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.hero h1 { max-width: 800px; }

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin-top: 1.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 3rem;
}


/* ══════════════════════════════════════════════════════════════════
   8. SECTIONS & LAYOUT
   ══════════════════════════════════════════════════════════════════ */

section {
  padding: 6rem 3rem;
  position: relative;
}

section::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}

/* Opt out of section divider */
section.no-border::after { display: none; }

.section-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
  display: block;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.028em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
}

.section-header { margin-bottom: 3.5rem; }

/* App layout helpers */
.app-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  margin-top: 72px;
}

.app-main {
  flex: 1;
  padding: 2rem 3rem;
  max-width: 960px;
}

.app-main-wide {
  flex: 1;
  padding: 2rem 3rem;
}

/* Container widths */
.container-sm  { max-width: 640px; margin: 0 auto; }
.container-md  { max-width: 960px; margin: 0 auto; }
.container-lg  { max-width: 1200px; margin: 0 auto; }
.container-xl  { max-width: 1400px; margin: 0 auto; }


/* ══════════════════════════════════════════════════════════════════
   9. BUTTONS
   ══════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled, .btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary, .btn.btn-primary {
  padding: 0.875rem 2rem;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--glow-lg);
  transform: translateY(-1px);
}

.btn-secondary, .btn.btn-secondary {
  padding: 0.875rem 2rem;
  background: transparent;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
}

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.btn-danger:hover {
  background: var(--danger-dim);
}

.btn-warning {
  background: transparent;
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
}

.btn-warning:hover {
  background: var(--warning-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card);
}

/* Sizes */
.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1rem;
}

/* Icon-only button */
.btn-icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Button group */
.btn-group {
  display: inline-flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.btn-group .btn:last-child  { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.btn-group .btn + .btn      { margin-left: -1px; }


/* ══════════════════════════════════════════════════════════════════
   10. BORDERED GRID SYSTEM (marketing)
   ══════════════════════════════════════════════════════════════════ */

.bordered-grid {
  display: grid;
  gap: 0;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

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

.bordered-card {
  padding: 2.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background 0.3s;
}

.bordered-card:hover { background: var(--bg-card); }

.bordered-card h3 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.bordered-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}


/* ══════════════════════════════════════════════════════════════════
   11. CARD SYSTEMS
   ══════════════════════════════════════════════════════════════════ */

/* Value Cards */
.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

.value-card {
  padding: 2.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.value-card:hover { background: var(--bg-card); }
.value-card h3 { font-size: 1.35rem; font-weight: 500; margin-bottom: 0.75rem; }
.value-card p  { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; }

.value-icon {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

/* Step Cards */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

.step-card {
  padding: 2.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.step-card:hover { background: var(--bg-card); }

.step-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
  opacity: 0.6;
}

.step-card h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: 0.75rem; }
.step-card p   { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; }

/* Feature Cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

.feature-card {
  padding: 2.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.feature-card:hover { background: var(--bg-card); }

.feature-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
}

.feature-value { font-size: 1.4rem; font-weight: 500; margin-bottom: 0.5rem; }
.feature-desc  { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; }

/* Detail Cards */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

.detail-card {
  padding: 2.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.detail-card .detail-title    { font-size: 1.3rem; font-weight: 500; margin-bottom: 0.25rem; }
.detail-card .detail-subtitle { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); letter-spacing: 0.1em; margin-bottom: 1rem; }
.detail-card .detail-body     { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; }

.detail-card .detail-badge {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
}

/* ── App-style cards (rounded, for dashboards) ── */
.card {
  background: var(--bg-card);
  border: var(--panel-border);
  border-radius: var(--panel-radius);
  padding: 1.5rem;
  transition: background 0.2s;
}

.card:hover { background: var(--bg-card-hover); }

.card-header {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.card-body { }

.card-footer {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* Selectable card (checkbox/radio style) */
.card-selectable {
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}

.card-selectable:hover { border-color: var(--text-muted); }
.card-selectable.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}


/* ══════════════════════════════════════════════════════════════════
   12. STATUS BADGES & TAGS
   ══════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.badge-success { color: var(--color-success); background: var(--success-dim); }
.badge-warning { color: var(--color-warning); background: var(--warning-dim); }
.badge-danger  { color: var(--color-danger);  background: var(--danger-dim); }
.badge-info    { color: var(--color-info);    background: var(--info-dim); }
.badge-purple  { color: var(--color-purple);  background: var(--purple-dim); }
.badge-muted   { color: var(--text-muted);    background: rgba(148, 163, 184, 0.1); }

/* Larger marketing-style badge */
.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
}

.status-live    { color: var(--accent);     background: var(--accent-dim); }
.status-planned { color: var(--text-muted); background: rgba(148, 163, 184, 0.1); }
.status-warning { color: var(--color-warning); background: var(--warning-dim); }
.status-danger  { color: var(--color-danger);  background: var(--danger-dim); }

/* Removable tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
}

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


/* ══════════════════════════════════════════════════════════════════
   13. STATS GRID
   ══════════════════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.stat-item { text-align: left; }

.stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Compact variant for dashboards */
.stat-compact .stat-value { font-size: 1.4rem; }
.stat-compact .stat-label { font-size: 0.7rem; }


/* ══════════════════════════════════════════════════════════════════
   14. FORMS & INPUTS
   ══════════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 1rem;
  position: relative;
}

.form-group label,
.form-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.8rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2rem;
  cursor: pointer;
}

/* Mono-font input variant (for codes, IDs, technical values) */
.form-input-mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* Layout helpers */
.form-row {
  display: flex;
  gap: 1rem;
}

.form-half    { flex: 1; }
.form-quarter { flex: 0.5; min-width: 0; }
.form-third   { flex: 0.333; min-width: 0; }

/* Hint text */
.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Checkbox & Radio */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.checkbox-item:hover,
.radio-item:hover {
  background: var(--bg-card);
}

/* Input error state */
.form-input.input-error,
.form-select.input-error,
.form-textarea.input-error {
  border-color: var(--color-danger);
}

.input-error-msg {
  color: var(--color-danger);
  font-size: 0.72rem;
  margin-top: 0.2rem;
}

/* Search dropdown */
.search-results {
  position: absolute;
  z-index: 100;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 2px;
}

.search-result-item {
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-primary);
  transition: background 0.1s;
}

.search-result-item:hover { background: var(--accent-dim); }
.search-result-item.disabled { color: var(--text-muted); cursor: default; }
.search-result-item.disabled:hover { background: none; }


/* ══════════════════════════════════════════════════════════════════
   15. TABLES
   ══════════════════════════════════════════════════════════════════ */

/* Wrap any .table in a .table-scroll for horizontal overflow on narrow screens.
   <div class="table-scroll"><table class="table">...</table></div> */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.table th {
  text-align: left;
  color: var(--text-muted);
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  color: var(--text-primary);
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.table tbody tr {
  transition: background 0.15s;
}

.table tbody tr:hover {
  background: var(--bg-card);
}

/* Clickable rows */
.table tbody tr.clickable {
  cursor: pointer;
}

.table tbody tr.clickable:hover {
  box-shadow: inset 2px 0 0 var(--accent);
}

/* Bordered variant (marketing phase tables) */
.table-bordered {
  border: 1px solid var(--border);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--border);
}

.table-bordered th {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 400;
  background: var(--bg-card);
}

/* Compact variant */
.table-compact th,
.table-compact td {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}

/* Sortable column header */
.table th.sortable {
  cursor: pointer;
  user-select: none;
}

.table th.sortable:hover { color: var(--text-primary); }

/* Review table (key-value layout) */
.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.review-table th {
  text-align: left;
  color: var(--text-muted);
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border-subtle);
  width: 140px;
  vertical-align: top;
  font-weight: normal;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.review-table td {
  color: var(--text-primary);
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border-subtle);
}

.review-table tr:last-child th,
.review-table tr:last-child td {
  border-bottom: none;
}


/* ══════════════════════════════════════════════════════════════════
   16. MODALS & DIALOGS
   ══════════════════════════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  padding-top: 100px;
  overflow: auto;
}

.modal-overlay.active { display: block; }

.modal {
  width: 65%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  animation: modal-slide-in 0.3s ease;
}

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-body {
  padding: 1rem 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.modal-close {
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.2s;
  line-height: 1;
}

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

@keyframes modal-slide-in {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes modal-slide-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-20px); }
}

.modal-overlay.closing { animation: fade-out 0.3s ease; }
.modal-overlay.closing .modal { animation: modal-slide-out 0.3s ease; }

@keyframes fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}


/* ══════════════════════════════════════════════════════════════════
   17. ALERTS & NOTIFICATIONS
   ══════════════════════════════════════════════════════════════════ */

.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border-left: 3px solid;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.alert-success {
  background: var(--success-dim);
  border-left-color: var(--color-success);
  color: var(--text-primary);
}

.alert-warning {
  background: var(--warning-dim);
  border-left-color: var(--color-warning);
  color: var(--text-primary);
}

.alert-danger {
  background: var(--danger-dim);
  border-left-color: var(--color-danger);
  color: var(--text-primary);
}

.alert-info {
  background: var(--info-dim);
  border-left-color: var(--color-info);
  color: var(--text-primary);
}

.alert-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

/* Toast (fixed position notification) */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  max-width: 400px;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  animation: slide-in-right 0.3s ease;
  cursor: pointer;
}

.toast-hiding { animation: slide-out-right 0.3s ease forwards; }

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slide-out-right {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}


/* ══════════════════════════════════════════════════════════════════
   18. TOOLTIPS
   ══════════════════════════════════════════════════════════════════ */

.tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  white-space: nowrap;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  visibility: hidden;
  opacity: 0;
  transform: translateY(0.5rem);
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 200;
}

.tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0.75rem;
  border: 4px solid transparent;
  border-bottom-color: var(--border);
}

/* Show on parent hover */
*:hover > .tooltip,
.tooltip-trigger:hover + .tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateY(0.25rem);
}


/* ══════════════════════════════════════════════════════════════════
   19. WIZARD & STEPPER
   ══════════════════════════════════════════════════════════════════ */

/* Wizard step indicators */
.wizard-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-card);
  transition: all 0.15s;
}

.wizard-step.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.wizard-step.done {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.wizard-step.clickable { cursor: pointer; }
.wizard-step.clickable:hover { background: var(--bg-card-hover); }

.wizard-step-num {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.65rem;
  font-family: var(--font-mono);
}

/* Wizard panel */
.wizard-panel {
  background: var(--bg-card);
  border: var(--panel-border);
  border-radius: var(--panel-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.wizard-panel h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Wizard navigation (back/next) */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}


/* ══════════════════════════════════════════════════════════════════
   20. SIDEBAR NAVIGATION
   ══════════════════════════════════════════════════════════════════ */

.sidebar {
  width: 220px;
  min-width: 220px;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-category {
  display: block;
  padding: 0.5rem 0.8rem 0.3rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.8rem;
}

.sidebar-category:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0 0;
}

.sidebar-menu li a,
.sidebar-link {
  display: block;
  padding: 0.35rem 0.8rem 0.35rem 1.2rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.sidebar-menu li a:hover,
.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.sidebar-menu li a.active,
.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}


/* ══════════════════════════════════════════════════════════════════
   21. PANELS & SECTIONS
   ══════════════════════════════════════════════════════════════════ */

.panel {
  background: var(--bg-surface);
  border: var(--panel-border);
  border-radius: var(--panel-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.panel-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Info grid (key-value pairs) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

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

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-item.full-width { grid-column: 1 / -1; }

.info-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.info-value {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.info-value-mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 1.5rem 0;
}

/* Detail row (inline key: value) */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-row:last-child { border-bottom: none; }

.detail-key { color: var(--text-muted); font-size: 0.75rem; }
.detail-val { color: var(--text-primary); font-family: var(--font-mono); font-size: 0.8rem; }


/* ══════════════════════════════════════════════════════════════════
   22. PAGINATION
   ══════════════════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 1rem;
}

.pagination a,
.pagination button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  text-align: center;
  text-decoration: none;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.pagination a.active,
.pagination button.active {
  font-weight: 600;
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.pagination a:hover:not(.active),
.pagination button:hover:not(.active) {
  background: var(--bg-card);
  color: var(--accent);
  border-color: var(--accent);
}

.pagination .ellipsis {
  min-width: auto;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: default;
}


/* ══════════════════════════════════════════════════════════════════
   23. TABS
   ══════════════════════════════════════════════════════════════════ */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

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

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Pill-style tabs */
.tabs-pills {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab-pill {
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-pill:hover { color: var(--text-primary); border-color: var(--border-hover); }
.tab-pill.active { color: var(--accent); background: var(--accent-dim); border-color: var(--accent); }


/* ══════════════════════════════════════════════════════════════════
   24. TOGGLE SWITCHES
   ══════════════════════════════════════════════════════════════════ */

.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity 0.3s, color 0.3s;
}

.toggle-label.active {
  opacity: 1;
  color: var(--accent);
}

.toggle {
  position: relative;
  width: 40px;
  height: 20px;
  padding: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
}

.toggle:hover { border-color: var(--accent); }

.toggle::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: var(--shadow-sm);
}

.toggle.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.toggle.active::before {
  transform: translateX(20px);
  background: var(--accent);
}


/* ══════════════════════════════════════════════════════════════════
   25. ENTITY BADGES & TAGS
   ══════════════════════════════════════════════════════════════════ */

.entity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.entity-type {
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.entity-name { color: var(--text-primary); }
.entity-extra { color: var(--text-muted); font-size: 0.7rem; }

.entity-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.2rem;
  line-height: 1;
}

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

/* Entity list (scrollable selector) */
.entity-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.entity-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

.entity-list-item:last-child { border-bottom: none; }
.entity-list-item:hover { background: var(--bg-card); }

.entity-list-item.selected {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
}


/* ══════════════════════════════════════════════════════════════════
   26. VALIDATION & FEEDBACK
   ══════════════════════════════════════════════════════════════════ */

.validation-warning {
  border-left: 3px solid var(--color-warning);
  background: var(--warning-dim);
  color: var(--color-warning);
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.4rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.78rem;
}

.validation-info {
  border-left: 3px solid var(--color-info);
  background: var(--info-dim);
  color: var(--color-info);
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.4rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.78rem;
}

.validation-ok {
  color: var(--color-success);
  font-size: 0.78rem;
  padding: 0.5rem 0;
}

/* Result feedback blocks */
.result-success {
  background: var(--success-dim);
  border: 1px solid var(--color-success);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.8rem;
}

.result-success code { color: var(--accent); }

.result-error {
  background: var(--danger-dim);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.8rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}


/* ══════════════════════════════════════════════════════════════════
   27. LOADING STATES & ANIMATIONS
   ══════════════════════════════════════════════════════════════════ */

.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 0.75rem; height: 0.75rem; border-width: 1.5px; }
.spinner-lg { width: 1.5rem; height: 1.5rem; border-width: 2.5px; }

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

/* Pulse animation (for live indicators) */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.pulse { animation: pulse 2s ease-in-out infinite; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 0.8rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.2rem; width: 60%; margin-bottom: 0.75rem; }
.skeleton-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; }


/* ══════════════════════════════════════════════════════════════════
   28. IMAGE & GALLERY GRIDS
   ══════════════════════════════════════════════════════════════════ */

.image-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 4rem;
  overflow: hidden;
}

.image-row img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  display: block;
  transition: all 0.4s ease;
  filter: brightness(0.92) contrast(1.05);
}

.image-row img:hover {
  filter: brightness(1) contrast(1.1);
  transform: scale(1.02);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

.image-grid .image-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  aspect-ratio: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.image-grid .image-cell:hover { background: var(--bg-card); }

.image-grid img {
  width: 200%;
  height: 200%;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.image-grid .image-cell:hover img { opacity: 1; }

/* Gallery */
.gallery-grid {
  display: grid;
  gap: 0;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

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

.gallery-item {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  aspect-ratio: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  transition: background 0.3s;
}

.gallery-item:hover { background: var(--bg-card); }
.gallery-item img   { width: 100%; height: 100%; object-fit: cover; }


/* ══════════════════════════════════════════════════════════════════
   29. PRICING
   ══════════════════════════════════════════════════════════════════ */

.pricing-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  margin-top: 2.5rem;
}

.pricing-points {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pricing-point {
  padding-left: 1.5rem;
  position: relative;
}

.pricing-point::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.pricing-point strong {
  display: block;
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.pricing-point span {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.pricing-highlight {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2.5rem;
  position: relative;
}

.pricing-highlight::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

.pricing-highlight h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: 1rem; }
.pricing-highlight p  { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; }


/* ══════════════════════════════════════════════════════════════════
   30. GLOBE & VISUALIZATION
   ══════════════════════════════════════════════════════════════════ */

.globe-container {
  display: grid;
  grid-template-columns: 600px 1fr;
  gap: 4rem;
  margin-top: 3rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  align-items: center;
}

.globe-wrapper {
  position: relative;
  width: 600px;
  height: 600px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: visible;
}

.globe-legend { display: flex; flex-direction: column; gap: 1.5rem; }

.legend-item { display: flex; align-items: start; gap: 1rem; }

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.legend-text  { flex: 1; }
.legend-label { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.05em; color: var(--text-primary); margin-bottom: 0.25rem; }
.legend-desc  { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }


/* ══════════════════════════════════════════════════════════════════
   31. CTA SECTION
   ══════════════════════════════════════════════════════════════════ */

.cta-section {
  text-align: center;
  padding: 8rem 5rem;
  background: var(--bg-secondary);
}

.cta-section h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.cta-section p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-inline: auto;
}

.cta-section .btn-primary {
  padding: 1rem 3rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}


/* ══════════════════════════════════════════════════════════════════
   32. FOOTER
   ══════════════════════════════════════════════════════════════════ */

footer {
  padding: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.footer-left { display: flex; align-items: center; gap: 2rem; }
.footer-logo svg { height: 18px; width: auto; opacity: 0.4; }
.footer-right { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; }

/* Tagged Headers */
.tagged-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.tagged-header h3 { font-size: 1.5rem; font-weight: 400; }


/* ══════════════════════════════════════════════════════════════════
   33. DITHER EFFECT
   ══════════════════════════════════════════════════════════════════ */

.dither-bg {
  position: absolute;
  top: -50%; left: 0; right: 0;
  height: 200%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.dither-bg.dither-ready {
  opacity: 0.25;
}

.dither-bg canvas { width: 100%; height: 100%; }

.has-dither { position: relative; overflow: hidden; }
.has-dither > *:not(.dither-bg) { position: relative; z-index: 2; }


/* ══════════════════════════════════════════════════════════════════
   34. UTILITIES
   ══════════════════════════════════════════════════════════════════ */

/* Typography */
.mono         { font-family: var(--font-mono); }
.accent       { color: var(--accent); }
.muted        { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-success { color: var(--color-success); }
.text-info    { color: var(--color-info); }

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

.font-sm      { font-size: 0.75rem; }
.font-xs      { font-size: 0.65rem; }
.font-lg      { font-size: 1.1rem; }

.uppercase    { text-transform: uppercase; letter-spacing: 0.08em; }
.nowrap       { white-space: nowrap; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Backgrounds */
.bg-primary   { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-card      { background: var(--bg-card); }
.bg-surface   { background: var(--bg-surface); }

/* Display */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.inline-flex  { display: inline-flex; }

.gap-xs       { gap: 0.25rem; }
.gap-sm       { gap: 0.5rem; }
.gap-md       { gap: 1rem; }
.gap-lg       { gap: 1.5rem; }
.gap-xl       { gap: 2rem; }

/* Grid */
.grid         { display: grid; }
.grid-2       { grid-template-columns: repeat(2, 1fr); }
.grid-3       { grid-template-columns: repeat(3, 1fr); }
.grid-4       { grid-template-columns: repeat(4, 1fr); }
.col-span-2   { grid-column: span 2; }
.col-span-full { grid-column: 1 / -1; }

/* Spacing */
.m-0  { margin: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-0  { padding: 0; }
.p-1  { padding: 0.5rem; }
.p-2  { padding: 1rem; }
.p-3  { padding: 1.5rem; }
.p-4  { padding: 2rem; }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

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

/* Cursor */
.pointer   { cursor: pointer; }
.no-select { user-select: none; }

/* Borders */
.border-0      { border: none; }
.border-top    { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }

/* Overflow */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }


/* ══════════════════════════════════════════════════════════════════
   35. THEME: DAY MODE (component overrides)
   ══════════════════════════════════════════════════════════════════ */

/* ── Theme toggle (nav) ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.3s;
  user-select: none;
}

.theme-label.active {
  color: var(--accent);
}

.theme-icon {
  display: none;
  align-items: center;
  color: var(--text-dim);
  transition: color 0.3s;
  line-height: 0;
}

.theme-icon-night { color: var(--accent); }
body.light-mode .theme-icon-night { color: var(--text-dim); }
body.light-mode .theme-icon-day { color: var(--accent); }

.theme-switch {
  position: relative;
  width: 36px;
  height: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.3s;
}

.theme-switch:hover {
  border-color: var(--accent);
}

.theme-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: var(--shadow-sm);
}

body.light-mode .theme-switch::before {
  transform: translateX(18px);
}

/* ── Nav ── */
body.light-mode nav {
  background: rgba(215, 215, 211, 0.85);
}

/* ── Logo SVGs ── */
body.light-mode .nav-logo svg,
body.light-mode .footer-logo svg {
  filter: invert(1) brightness(0.35) contrast(1.2);
}

/* ── Deck mode toggle (from deck.js) ── */
body.light-mode .mode-toggle {
  background: rgba(215, 215, 211, 0.85);
}

/* ── Deck chrome ── */
body.light-mode .deck-chrome-logo {
  filter: invert(1) brightness(0.35) contrast(1.2);
}

/* ── Deck nav arrows ── */
body.light-mode .deck-nav-arrow {
  background: rgba(215, 215, 211, 0.6);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.4);
}

body.light-mode .deck-nav-arrow:active {
  color: rgba(0, 0, 0, 0.8);
}

/* ── Form select arrow (dark chevron on light bg) ── */
body.light-mode .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c6370' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
}

/* ── Badge-muted ── */
body.light-mode .badge-muted {
  background: rgba(92, 99, 112, 0.1);
}

/* ── Status planned ── */
body.light-mode .status-planned {
  background: rgba(92, 99, 112, 0.1);
}


/* ══════════════════════════════════════════════════════════════════
   36. RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */

@media screen and (max-width: 900px) {
  /* Navigation */
  nav { padding: 0 1.5rem; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .theme-toggle .theme-label { display: none; }
  .theme-icon { display: flex; }
  .theme-toggle {
    transition: opacity 0.3s ease;
  }
  body.scrolling .theme-toggle {
    opacity: 0;
    pointer-events: none;
  }

  /* Layout — everything gets tighter gutters + prevent table overflow */
  .hero,
  section,
  .cta-section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    max-width: 100vw;
    overflow-x: auto;
  }

  /* Grids → single column */
  .value-grid,
  .steps-grid,
  .feature-grid,
  .detail-grid,
  .stats-grid,
  .bordered-grid-2,
  .bordered-grid-3,
  .bordered-grid-4,
  .info-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

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

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

  .pricing-content { grid-template-columns: 1fr; }

  /* Globe */
  .globe-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .globe-wrapper {
    width: 100%;
    max-width: 100%;
    height: 350px;
    margin: 0 auto;
  }

  /* Images */
  .image-row { grid-template-columns: 1fr; }
  .image-row img { height: 300px; }

  /* Phase Headers */
  .tagged-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  /* Footer */
  footer {
    padding: 2rem 1.5rem;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .footer-left {
    flex-direction: column;
    gap: 1rem;
  }

  /* App layout */
  .sidebar {
    width: 160px;
    min-width: 160px;
  }

  .app-main,
  .app-main-wide {
    padding: 1rem;
  }

  /* Forms */
  .form-row { flex-direction: column; }

  /* Wizard steps */
  .wizard-steps { flex-wrap: wrap; }

  /* Modal */
  .modal { width: 90%; }

  /* Code blocks */
  pre { font-size: 0.78em; }
}

@media screen and (max-width: 600px) {
  .sidebar { display: none; }

  /* Tighter gutters */
  .hero,
  section,
  .cta-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  footer { padding: 1.5rem 1rem; }

  .gallery-grid-2,
  .gallery-grid-3,
  .gallery-grid-4 {
    grid-template-columns: 1fr;
  }

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

  .globe-wrapper { height: 280px; }

  /* Scale type for small screens */
  h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); }
  h2 { font-size: clamp(1.3rem, 5vw, 2rem); }
}

/* Print */
@media print {
  nav, footer, .sidebar, .wizard-nav, .btn, .pagination, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .panel, .wizard-panel { border: 1px solid #ccc; background: #fff; }
  .table th, .table td { border: 1px solid #ccc; color: #000; }
}
