/* ============================================================
   RUSLO.SOFTWARE — STYLES.CSS
   Enterprise B2B Landing Page
   Architecture: Mobile-First, CSS Variables, Grid/Flex
   ============================================================ */

/* ── 1. CSS CUSTOM PROPERTIES ─────────────────────────────── */
:root {
  /* Colors */
  --color-bg:         #f8fafc;
  --color-bg-panel:   #ffffff;
  --color-bg-muted:   #f1f5f9;
  --color-border:     #e2e8f0;
  --color-border-dark:#cbd5e1;

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

  --color-accent:       #10b981; /* Приглушений смарагдовий — тільки для графіків */
  --color-accent-dark:  #059669;
  --color-accent-faint: #d1fae5;

  --color-bar-1: #10b981;
  --color-bar-2: #34d399;
  --color-bar-3: #6ee7b7;
  --color-bar-neg: #f43f5e;

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

  --text-xs:   0.6875rem; /* 11px */
  --text-sm:   0.8125rem; /* 13px */
  --text-base: 0.9375rem; /* 15px */
  --text-md:   1.0625rem; /* 17px */
  --text-lg:   1.25rem;   /* 20px */
  --text-xl:   1.5rem;    /* 24px */
  --text-2xl:  2rem;      /* 32px */
  --text-3xl:  2.75rem;   /* 44px */
  --text-4xl:  3.5rem;    /* 56px */

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold: 600;
  --weight-bold:    700;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Grid */
  --container-max: 1200px;
  --grid-pattern-size: 40px;
}


/* ── 2. MODERN CSS RESET ──────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

ul, ol {
  list-style: none;
}

/* ── 3. BACKGROUND GRID LAYER ─────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: var(--grid-pattern-size) var(--grid-pattern-size);
  opacity: 0.45;
}

/* ── 4. LAYOUT CONTAINER ──────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
  position: relative;
  z-index: 1;
}

/* ── 5. HEADER ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  height: 60px;
  /* Prevent CLS: fixed height */
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.logo-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logo-name {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  line-height: 1;
}

.logo-name span {
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
}

.btn-login {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
  color: #ffffff;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-5);
  text-decoration: none;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.06);
  cursor: pointer;
}

.btn-login:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.btn-login-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn-login:hover .btn-login-icon {
  transform: translateX(2px);
}

/* ── 6. MAIN / HERO SECTION ───────────────────────────────── */
.site-main {
  position: relative;
  z-index: 1;
}

.hero {
  padding-top: var(--space-16);
  padding-bottom: var(--space-20);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: start;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
  }
}

/* ── 6a. HERO — LEFT COLUMN ───────────────────────────────── */
.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  width: fit-content;
}

.hero-label::before,
.hero-label::after {
  content: '';
  display: block;
  height: 1px;
  width: 24px;
  background-color: var(--color-border-dark);
}

.hero-title {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--color-text-primary);
}

.hero-title em {
  font-style: normal;
  color: var(--color-text-secondary);
}

.hero-description {
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 480px;
}

/* CTA Button */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background-color: var(--color-text-primary);
  color: var(--color-bg);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  border: 1px solid var(--color-text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
  text-decoration: none;
  width: fit-content;
}

.btn-cta:hover {
  background-color: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.15);
}

.btn-cta:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-cta-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn-cta:hover .btn-cta-arrow {
  transform: translateX(3px);
}

/* Feature Grid 2x2 */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background-color: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base),
              box-shadow var(--transition-base);
}

.feature-card:hover {
  border-color: var(--color-border-dark);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.feature-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.feature-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.feature-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ── 6b. HERO — RIGHT COLUMN (CSS Dashboard) ──────────────── */
.dashboard-panel {
  background-color: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04), 0 8px 32px rgba(15,23,42,0.06);
}

/* Dashboard titlebar */
.dash-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-muted);
}

.dash-dots {
  display: flex;
  gap: var(--space-2);
}

.dash-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--color-border-dark);
}

.dash-title-text {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.dash-period {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  background-color: var(--color-bg-panel);
}

/* Dashboard body */
.dash-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* KPI Row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.kpi-card {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
  margin-bottom: var(--space-1);
}

.kpi-value {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-1);
}

.kpi-delta.up   { color: var(--color-accent); }
.kpi-delta.down { color: var(--color-bar-neg); }

/* Chart area */
.chart-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  flex-shrink: 0;
}
.legend-dot.revenue { background-color: var(--color-accent); }
.legend-dot.expenses { background-color: var(--color-text-muted); }

/* Bar chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  height: 120px;
  padding-top: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.bar-stack {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
  width: 100%;
  justify-content: center;
}

.bar {
  width: 10px;
  border-radius: 2px 2px 0 0;
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  /* Initial: height set via inline style or JS */
}

.bar.revenue  { background-color: var(--color-accent); }
.bar.expenses { background-color: var(--color-border-dark); }

.bar-label {
  font-size: 9px;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  margin-top: var(--space-1);
}

/* Cash flow table */
.cf-table {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.cf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
}

.cf-row:first-child {
  background-color: var(--color-accent-faint);
  border-color: transparent;
}

.cf-name {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
}

.cf-row:first-child .cf-name {
  color: var(--color-accent-dark);
  font-weight: var(--weight-semibold);
}

.cf-amount {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
}

.cf-row:first-child .cf-amount {
  color: var(--color-accent-dark);
}

/* Status bar */
.dash-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  gap: var(--space-4);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
  animation: pulse 2s ease-in-out infinite;
}

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

.dash-version {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

/* ── 7. DIVIDER SECTION ───────────────────────────────────── */
.divider-section {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-panel);
  padding: var(--space-8) 0;
  overflow: hidden;
}

.stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  justify-content: space-between;
  align-items: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 140px;
}

.stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  line-height: 1;
}

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

.stat-separator {
  width: 1px;
  height: 40px;
  background-color: var(--color-border);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .stat-separator { display: none; }
  .stats-strip { gap: var(--space-6); }
}

/* ── 8. FOOTER ────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) 0;
  background-color: var(--color-bg);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer-copyright {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.footer-copyright a {
  color: var(--color-text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.footer-copyright a:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-dark);
}

.footer-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.footer-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-full);
  background-color: var(--color-border-dark);
}

.footer-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-accent);
  letter-spacing: 0.04em;
}

.footer-status-dot {
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
  animation: pulse 2.5s ease-in-out infinite;
}

/* ── 9. ANIMATIONS & ENTRY ────────────────────────────────── */
.animate-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays */
.animate-in[data-delay="1"] { transition-delay: 0.1s; }
.animate-in[data-delay="2"] { transition-delay: 0.2s; }
.animate-in[data-delay="3"] { transition-delay: 0.3s; }
.animate-in[data-delay="4"] { transition-delay: 0.4s; }
.animate-in[data-delay="5"] { transition-delay: 0.5s; }

/* ── 10. UTILITY ──────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
