/* BizCompliance API - Design System
   Theme: Developer-focused, dark mode, trust-and-authority
   Aesthetic: Middesk meets Stripe docs */

:root {
  /* Core palette */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2235;
  --bg-card: #151d2e;
  --bg-code: #0d1117;
  --bg-highlight: #1e293b;

  /* Accent - trust blue with compliance green */
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-muted: rgba(59, 130, 246, 0.15);
  --accent-border: rgba(59, 130, 246, 0.3);
  --green: #10b981;
  --green-muted: rgba(16, 185, 129, 0.15);
  --green-border: rgba(16, 185, 129, 0.3);
  --amber: #f59e0b;
  --amber-muted: rgba(245, 158, 11, 0.15);
  --red: #ef4444;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #60a5fa;
  --text-on-accent: #ffffff;

  /* Borders */
  --border: #1e293b;
  --border-hover: #334155;
  --border-accent: rgba(59, 130, 246, 0.4);

  /* Sizing */
  --max-width: 1200px;
  --nav-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);

  /* Transitions */
  --transition: 150ms ease;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip Navigation */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only-focusable:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  padding: 15px 20px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: bold;
  z-index: 10000;
  border-radius: var(--radius-sm);
}

/* Focus indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }

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

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

code, pre {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

/* Navigation */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-logo svg { flex-shrink: 0; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text-primary);
}
.nav-cta {
  background: var(--accent);
  color: var(--text-on-accent) !important;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  transition: background var(--transition);
}
.nav-cta:hover { background: var(--accent-hover); }

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

main { padding-top: var(--nav-height); }

section {
  padding: 80px 0;
}
@media (max-width: 768px) {
  section { padding: 48px 0; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--text-on-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}
.btn-secondary:hover {
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-accent);
  padding: 8px 16px;
}
.btn-ghost:hover { background: var(--accent-muted); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

/* Code blocks */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.code-header .lang { font-weight: 600; color: var(--text-secondary); }
.code-content {
  padding: 16px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}
.code-content code {
  color: var(--text-secondary);
}
.code-content .key { color: #7dd3fc; }
.code-content .str { color: #86efac; }
.code-content .num { color: #fbbf24; }
.code-content .bool { color: #c084fc; }
.code-content .comment { color: var(--text-muted); font-style: italic; }

/* Badge / pill */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.badge-accent {
  background: var(--accent-muted);
  color: var(--text-accent);
  border: 1px solid var(--accent-border);
}
.badge-green {
  background: var(--green-muted);
  color: var(--green);
  border: 1px solid var(--green-border);
}

/* Stats */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 24px 0;
  flex-wrap: wrap;
}
.stat {
  text-align: center;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 968px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
}

/* Pricing cards */
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
}
.pricing-card.featured {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-glow);
  position: relative;
}
.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pricing-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}
.pricing-price {
  margin: 16px 0;
}
.pricing-amount {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}
.pricing-period {
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.pricing-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  flex-grow: 1;
}
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.pricing-features li svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--green);
}
.pricing-card .btn { width: 100%; justify-content: center; }

/* Section headers */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  margin-bottom: 16px;
}
.section-desc {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 640px;
}
.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-header .section-desc {
  margin: 0 auto;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  background: var(--bg-secondary);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}
.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 12px;
  max-width: 280px;
}
.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 16px;
}

/* Email capture */
.email-form {
  display: flex;
  gap: 8px;
  max-width: 420px;
}
.email-form input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9375rem;
}
.email-form input::placeholder { color: var(--text-muted); }
.email-form input:focus {
  border-color: var(--accent);
  outline: none;
}
.email-form button {
  white-space: nowrap;
}
.email-msg {
  font-size: 0.8125rem;
  margin-top: 8px;
  min-height: 20px;
}
.email-msg.success { color: var(--green); }
.email-msg.error { color: var(--red); }

/* Gap visualization */
.gap-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 40px 24px;
  position: relative;
}
.gap-option {
  text-align: center;
  padding: 20px 24px;
  position: relative;
  flex: 0 0 auto;
}
.gap-price {
  font-size: 1.5rem;
  font-weight: 800;
}
.gap-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.gap-arrow {
  color: var(--text-muted);
  font-size: 1.5rem;
  padding: 0 16px;
}
.gap-highlight {
  background: var(--accent-muted);
  border: 2px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 20px 32px;
}
.gap-highlight .gap-price { color: var(--accent); }
.gap-highlight .gap-label { color: var(--text-accent); }
@media (max-width: 640px) {
  .gap-visual { flex-direction: column; gap: 8px; }
  .gap-arrow { transform: rotate(90deg); padding: 8px; }
}

/* Interactive demo */
.demo-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 868px) {
  .demo-container { grid-template-columns: 1fr; }
}
.demo-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.demo-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.demo-field select,
.demo-field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9375rem;
}
.demo-field select:focus,
.demo-field input:focus {
  border-color: var(--accent);
  outline: none;
}
.demo-result {
  min-height: 300px;
}

/* Utility */
.text-center { text-align: center; }
.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, #818cf8 50%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* Animations */
@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
  }
}
