/* ============================================================
   PopPay QRIS SDK - Design System
   Pure CSS, no frameworks
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --color-primary: #1e40af;
  --color-primary-light: #3b82f6;
  --color-primary-dark: #1e3a8a;
  --color-accent: #0d9488;
  --color-accent-light: #14b8a6;
  --color-accent-dark: #0f766e;

  --color-bg: #f8fafc;
  --color-bg-alt: #f1f5f9;
  --color-surface: #ffffff;
  --color-surface-hover: #f8fafc;

  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #ffffff;

  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;

  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-info: #0284c7;
  --color-info-bg: #f0f9ff;
  --color-info-border: #bae6fd;
  --color-expired: #6b7280;
  --color-expired-bg: #f9fafb;
  --color-expired-border: #e5e7eb;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  --container-max: 1200px;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

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

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--color-text);
}

h1 { font-size: 2.5rem; letter-spacing: -0.025em; }
h2 { font-size: 1.875rem; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { color: var(--color-text-secondary); }

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.nav-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 0.85rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.nav-links a:hover {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: background var(--transition-base);
}

.status-dot.connected {
  background: var(--color-success);
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.4);
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text);
}

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

/* --- Section Spacing --- */
.section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  margin-bottom: 0.75rem;
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: rgba(30, 64, 175, 0.08);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

/* --- Hero --- */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.03) 0%, transparent 100%);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto 3rem;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: all var(--transition-base);
}

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

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.875rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.feature-icon.blue   { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.feature-icon.teal   { background: rgba(13, 148, 136, 0.1); color: #0d9488; }
.feature-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.feature-icon.amber  { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.feature-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.375rem;
}

.feature-card p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

/* Code Preview */
.code-preview {
  max-width: 640px;
  margin: 0 auto;
  background: #1e293b;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow-xl);
}

.code-preview-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #0f172a;
  border-bottom: 1px solid #334155;
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dot.red    { background: #ef4444; }
.code-dot.yellow { background: #eab308; }
.code-dot.green  { background: #22c55e; }

.code-preview-header span {
  font-size: 0.75rem;
  color: #64748b;
  margin-left: auto;
  font-family: var(--font-mono);
}

.code-preview pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #e2e8f0;
}

.code-preview .kw  { color: #c084fc; }
.code-preview .fn  { color: #67e8f9; }
.code-preview .str { color: #86efac; }
.code-preview .num { color: #fbbf24; }
.code-preview .cm  { color: #64748b; }
.code-preview .prop { color: #93c5fd; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}
.btn-accent:hover:not(:disabled) {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-outline:hover:not(:disabled) {
  background: var(--color-bg-alt);
  border-color: var(--color-text-muted);
}

.btn-success {
  background: var(--color-success);
  color: var(--color-text-inverse);
}
.btn-success:hover:not(:disabled) {
  background: #15803d;
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-text-inverse);
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* --- Card --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

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

.card-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Payment Demo Section --- */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.375rem;
}

.form-label .required {
  color: var(--color-danger);
  margin-left: 2px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

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

.form-input-group {
  position: relative;
}

.form-input-group .prefix {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  pointer-events: none;
}

.form-input-group .form-input {
  padding-left: 2.5rem;
}

/* Quick Amount Chips */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.chip {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  background: rgba(59, 130, 246, 0.04);
}

.chip.active {
  border-color: var(--color-primary);
  background: rgba(30, 64, 175, 0.08);
  color: var(--color-primary);
}

/* Payment Result Area */
.payment-result-area {
  min-height: 300px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--color-bg-alt);
  transition: all var(--transition-base);
}

.payment-result-area.active {
  border-color: var(--color-primary-light);
  background: var(--color-surface);
  border-style: solid;
}

.payment-placeholder {
  text-align: center;
  color: var(--color-text-muted);
}

.payment-placeholder svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.4;
}

.payment-placeholder p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Backend Toggle */
.backend-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  margin-top: 1.5rem;
  border: 1px solid var(--color-border);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.backend-url-input {
  flex: 1;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--color-text);
  background: var(--color-surface);
}

.backend-url-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Test Suite --- */
.test-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.test-progress {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.test-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

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

.test-stat {
  text-align: center;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.test-stat .value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}

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

.test-stat.passed .value { color: var(--color-success); }
.test-stat.failed .value { color: var(--color-danger); }
.test-stat.total  .value { color: var(--color-primary); }
.test-stat.rate   .value { color: var(--color-accent); }

/* Test Category */
.test-category {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
}

.test-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.test-category-header:hover {
  background: var(--color-bg-alt);
}

.test-category-header h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.test-category-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0.2rem 0.5rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
}

.test-category-chevron {
  transition: transform var(--transition-fast);
  color: var(--color-text-muted);
}

.test-category.open .test-category-chevron {
  transform: rotate(180deg);
}

.test-category-body {
  display: none;
  padding: 0 1.25rem 1rem;
}

.test-category.open .test-category-body {
  display: block;
}

/* Individual Test Item */
.test-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border-light);
  animation: fadeIn 0.3s ease;
}

.test-item:last-child {
  border-bottom: none;
}

.test-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.test-icon.pass { color: var(--color-success); }
.test-icon.fail { color: var(--color-danger); }
.test-icon.pending { color: var(--color-text-muted); }

.test-info { flex: 1; min-width: 0; }

.test-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}

.test-detail {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.125rem;
  font-family: var(--font-mono);
  word-break: break-word;
}

/* --- Order History --- */
.orders-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-group {
  display: flex;
  gap: 0.375rem;
}

.filter-btn {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.orders-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

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

.orders-table thead {
  background: var(--color-bg-alt);
}

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

.orders-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.orders-table tbody tr:hover {
  background: var(--color-bg-alt);
}

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

.orders-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

.orders-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.3;
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge-paid {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.badge-pending {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-failed {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.badge-expired {
  background: var(--color-expired-bg);
  color: var(--color-expired);
  border: 1px solid var(--color-expired-border);
}

/* --- Config Reference Table --- */
.config-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

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

.config-table thead {
  background: var(--color-bg-alt);
}

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

.config-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

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

.config-table code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--color-bg-alt);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  color: var(--color-primary);
}

.config-table .required-yes {
  color: var(--color-danger);
  font-weight: 600;
}

.config-table .required-no {
  color: var(--color-text-muted);
}

/* --- Footer --- */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  font-size: 0.825rem;
  color: var(--color-text-muted);
}

.footer-left a {
  color: var(--color-primary);
  font-weight: 500;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

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

/* --- Event Log Drawer --- */
.event-log {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
  overflow: hidden;
}

.event-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}

.event-log-header h4 {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.log-count {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--color-primary);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.event-log-body {
  max-height: 250px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.5rem 0;
}

.log-entry {
  padding: 0.25rem 1rem;
  line-height: 1.5;
  border-left: 3px solid transparent;
}

.log-entry.info    { color: var(--color-info); border-left-color: var(--color-info); }
.log-entry.success { color: var(--color-success); border-left-color: var(--color-success); }
.log-entry.error   { color: var(--color-danger); border-left-color: var(--color-danger); }
.log-entry.warn    { color: var(--color-warning); border-left-color: var(--color-warning); }

.log-time {
  color: var(--color-text-muted);
  margin-right: 0.5rem;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.text-mono   { font-family: var(--font-mono); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

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

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

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

.animate-pulse { animation: pulse 2s infinite; }
.animate-spin  { animation: spin 1s linear infinite; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .hero-features {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .section { padding: 3rem 0; }
  .hero { padding: 4rem 0 2.5rem; }

  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-md);
  }

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

  .orders-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .hero-features {
    grid-template-columns: 1fr;
    max-width: 340px;
  }

  .test-summary {
    grid-template-columns: 1fr 1fr;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .card { padding: 1.25rem; }
}
