/* ==========================================================================
   OpenBalancer — Modern High-Performance Design System (Vanilla CSS)
   Operated by INCONTROL PLUS ЕООД
   ========================================================================== */

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.95);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #3b82f6;
  
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);
  --accent: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 25px var(--primary-glow);
  
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.25s ease-in-out;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Typography & Links */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: 1rem; }
h3 { font-size: 1.35rem; }
p { color: var(--text-muted); font-size: 1.05rem; }

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

a:hover {
  color: #60a5fa;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: rgba(11, 15, 25, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow);
}

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

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--text-main);
}

.nav-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: #374151;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

/* Hero Section */
.hero-section {
  padding: 5.5rem 0 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 650px;
  height: 350px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(16, 185, 129, 0.05) 50%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-title {
  margin-bottom: 1.25rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  max-width: 720px;
  margin: 0 auto 2.25rem;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
}

/* Code Snippet Card */
.code-preview-card {
  max-width: 750px;
  margin: 0 auto;
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  text-align: left;
  overflow: hidden;
}

.code-header {
  background: #161b22;
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.code-filename {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.code-body {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #e6edf3;
  overflow-x: auto;
}

.code-body pre {
  margin: 0;
}

/* Section Header */
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  display: block;
}

/* Grid Layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2rem;
}

/* Feature Cards */
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  margin-bottom: 0.75rem;
}

/* Interactive Simulator / Live Visualizer */
.simulator-section {
  padding: 5rem 0;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.simulator-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
}

.sim-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.sim-stats {
  display: flex;
  gap: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

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

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.stat-value.healthy { color: var(--accent); }

.sim-visualizer {
  display: grid;
  grid-template-columns: 1fr auto 1.5fr;
  align-items: center;
  gap: 2rem;
  padding: 2rem 0;
}

.sim-client-node {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.sim-balancer-node {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-glow);
}

.sim-backends {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.backend-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-fast);
}

.backend-card.active {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
}

.backend-status-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.backend-status-pill.up {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent);
}

.backend-status-pill.down {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* Enterprise & B2B Section */
.enterprise-section {
  padding: 5.5rem 0;
}

.b2b-highlight-box {
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.6) 0%, rgba(17, 24, 39, 0.9) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 3rem;
  margin-bottom: 3.5rem;
}

.b2b-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.b2b-meta-item {
  border-left: 3px solid var(--primary);
  padding-left: 1rem;
}

.b2b-meta-item strong {
  display: block;
  color: var(--text-main);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

/* Case Study: FinansProtect */
.case-study-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.case-study-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.case-study-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.metric-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Pricing / Plans */
.pricing-section {
  padding: 5rem 0;
  background-color: var(--bg-secondary);
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-fast);
}

.pricing-card:hover {
  transform: translateY(-4px);
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.popular-badge {
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1.25rem 0 0.5rem;
  font-family: var(--font-mono);
}

.pricing-features {
  list-style: none;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex-grow: 1;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pricing-features li svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* Footer (Compliance & Stripe Ready) */
.site-footer {
  background-color: #070a12;
  border-top: 1px solid var(--border-color);
  padding: 4.5rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

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

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

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

.footer-compliance-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer-compliance-card strong {
  color: var(--text-main);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Legal Pages Styling */
.legal-page-header {
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2.5rem;
}

.legal-content {
  max-width: 840px;
  margin: 0 auto 5rem;
  line-height: 1.75;
}

.legal-content h2 {
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.legal-content h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.75rem;
}

.legal-content p, .legal-content ul, .legal-content ol {
  margin-bottom: 1.25rem;
  color: #d1d5db;
}

.legal-content ul, .legal-content ol {
  padding-left: 1.75rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.legal-box {
  background: var(--bg-tertiary);
  border-left: 4px solid var(--primary);
  padding: 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
}

/* Form & Modal Styling */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
  position: relative;
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

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

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #e5e7eb;
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-success-box {
  display: none;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .case-study-card {
    grid-template-columns: 1fr;
  }
  .sim-visualizer {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

