/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #FAF7F2;
  --fg: #1A1A18;
  --accent: #D97706;
  --teal: #0A2E2E;
  --teal-mid: #0F3D3D;
  --muted: #6B6B60;
  --border: #E5E1D8;
  --card-bg: #FFFFFF;
  --paid: #16A34A;
  --pending: #D97706;
  --overdue: #DC2626;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --max-w: 1140px;
  --pad-x: clamp(24px, 5vw, 64px);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* === NAV === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--teal); }
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--fg); }

/* === SECTION SHARED === */
section { padding: clamp(64px, 10vw, 120px) var(--pad-x); }
.inner { max-width: var(--max-w); margin: 0 auto; }
.section-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.section-headline { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.15; color: var(--teal); margin-bottom: 20px; }
.centered { text-align: center; }

/* === HERO === */
.hero { background: var(--bg); }
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-eyebrow { font-size: 0.875rem; font-weight: 500; color: var(--accent); letter-spacing: 0.05em; margin-bottom: 16px; }
.hero-headline { font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; color: var(--teal); margin-bottom: 20px; }
.hero-sub { font-size: 1.05rem; color: var(--muted); max-width: 480px; line-height: 1.7; }

/* Invoice sample card in hero text */
.hero-invoice-sample {
  margin-top: 32px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  max-width: 380px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}
.inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.inv-logo { display: flex; align-items: center; gap: 8px; }
.inv-logo-mark { width: 28px; height: 28px; background: var(--teal); border-radius: 6px; }
.inv-logo-text { display: flex; flex-direction: column; }
.inv-logo-text strong { font-size: 0.8rem; font-weight: 600; }
.inv-logo-text span { font-size: 0.7rem; color: var(--muted); }
.inv-meta { text-align: right; }
.inv-num { font-size: 0.75rem; font-weight: 600; display: block; color: var(--muted); }
.inv-pending { font-size: 0.7rem; background: #FEF3C7; color: #92400E; padding: 2px 8px; border-radius: 20px; font-weight: 500; }
.inv-body { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 12px 0; }
.inv-row { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 4px 0; }
.inv-row span:first-child { color: var(--muted); }
.inv-total { display: flex; justify-content: space-between; padding: 12px 0 8px; font-weight: 700; font-size: 0.9rem; }
.inv-total-amt { color: var(--teal); }
.inv-mpesa { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--paid); }
.mpesa-dot { width: 6px; height: 6px; background: var(--paid); border-radius: 50%; }

/* Dashboard widget */
.hero-dashboard { display: flex; justify-content: center; }
.dash-card {
  background: var(--teal);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  color: white;
}
.dash-kpi-row { display: flex; justify-content: space-between; margin-bottom: 24px; }
.dash-kpi { text-align: center; }
.kpi-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.5); display: block; margin-bottom: 4px; }
.kpi-val { font-size: 1.4rem; font-weight: 700; display: block; }
.kpi-val.collected { color: #4ADE80; }
.kpi-val.warning { color: #FCA5A5; }

/* Chart bars */
.dash-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  margin-bottom: 8px;
  padding: 0 4px;
}
.chart-bar {
  flex: 1;
  height: calc(var(--h) * 1%);
  background: rgba(255,255,255,0.15);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s;
}
.chart-bar.active { background: var(--accent); }
.dash-trend { font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-bottom: 24px; }
.trend-up { color: #4ADE80; font-weight: 600; margin-right: 6px; }

/* Recent invoices in dashboard */
.dash-recent { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px; }
.dash-inv-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.di-name { font-size: 0.82rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.di-amt { font-size: 0.82rem; font-weight: 600; }
.di-stamp { font-size: 0.68rem; padding: 2px 8px; border-radius: 20px; font-weight: 500; }
.di-stamp.paid { background: rgba(74,222,128,0.15); color: #4ADE80; }
.di-stamp.pending { background: rgba(217,119,6,0.15); color: var(--accent); }
.di-stamp.overdue { background: rgba(252,165,165,0.15); color: #FCA5A5; }

/* === FEATURES === */
.features { background: var(--bg); }
.features-inner { max-width: var(--max-w); margin: 0 auto; }
.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 48px; }
.feat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.feat-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
.feat-accent-bar { position: absolute; top: 0; left: 0; width: 4px; height: 48px; background: var(--accent); border-radius: 0 0 4px 0; }
.feat-icon { width: 40px; height: 40px; background: #FEF3C7; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feat-card h3 { font-size: 1.1rem; font-weight: 600; color: var(--teal); margin-bottom: 8px; }
.feat-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.feat-list { list-style: none; }
.feat-list li { font-size: 0.85rem; color: var(--fg); padding: 4px 0; padding-left: 16px; position: relative; }
.feat-list li::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
.feat-card.feat-primary { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.feat-card.feat-primary h3 { grid-column: 1; }
.feat-card.feat-primary p { grid-column: 1; }
.feat-card.feat-primary .feat-list { grid-column: 1; }
.feat-card.feat-primary .feat-icon { grid-column: 2; grid-row: 1; }

/* === INVOICE PREVIEW === */
.invoice-preview { background: var(--teal); color: white; }
.ip-inner { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.ip-text .section-label { color: var(--accent); }
.ip-text .section-headline { color: white; }
.ip-desc { font-size: 1rem; color: rgba(255,255,255,0.65); line-height: 1.7; margin-bottom: 40px; }
.ip-steps { display: flex; flex-direction: column; gap: 24px; }
.ip-step { display: flex; gap: 20px; align-items: flex-start; }
.step-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1; min-width: 40px; }
.step-body { display: flex; flex-direction: column; gap: 2px; }
.step-body strong { font-size: 0.95rem; font-weight: 600; color: white; }
.step-body span { font-size: 0.85rem; color: rgba(255,255,255,0.55); line-height: 1.5; }

/* Invoice card */
.inv-card {
  background: white;
  border-radius: 20px;
  padding: 32px;
  color: var(--fg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.inv-top { display: flex; justify-content: space-between; margin-bottom: 20px; }
.inv-from, .inv-to { font-size: 0.8rem; }
.inv-from strong, .inv-to strong { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); display: block; margin-bottom: 4px; }
.inv-from span, .inv-to span { display: block; color: var(--fg); font-weight: 500; }
.inv-from span + span, .inv-to span + span { color: var(--muted); font-weight: 400; }
.inv-info-row { display: flex; gap: 16px; align-items: center; padding: 10px 16px; background: #F9F7F4; border-radius: 8px; margin-bottom: 20px; }
.inv-tag { font-size: 0.75rem; font-weight: 700; color: var(--teal); }
.inv-date, .inv-due { font-size: 0.75rem; color: var(--muted); }
.inv-lines { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.inv-line { display: flex; justify-content: space-between; font-size: 0.85rem; }
.inv-line span:first-child { color: var(--muted); }
.inv-line span:last-child { font-weight: 500; }
.inv-grand-total { display: flex; justify-content: space-between; padding: 16px 0 20px; font-size: 1rem; font-weight: 700; color: var(--teal); }
.inv-payment-method { background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 10px; padding: 12px 16px; }
.pm-row { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 500; color: var(--paid); margin-bottom: 4px; }
.pm-txid { font-size: 0.72rem; color: var(--muted); font-family: 'Courier New', monospace; }

/* === REPORTING === */
.reporting { background: var(--bg); }
.rep-inner { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.rep-text .section-headline { color: var(--teal); }
.rep-text p { font-size: 1rem; color: var(--muted); line-height: 1.7; margin-bottom: 28px; }
.rep-points { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.rep-points li { display: flex; align-items: center; gap: 12px; font-size: 0.95rem; font-weight: 500; color: var(--fg); }

/* Chart card */
.rep-chart-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; padding: 28px; }
.rep-chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 0.85rem; font-weight: 600; color: var(--teal); }
.rep-badge { font-size: 0.7rem; background: var(--accent); color: white; padding: 2px 10px; border-radius: 20px; font-weight: 500; }
.rep-big-num { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.rep-big-num span { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; color: var(--teal); }
.rep-trend { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.rep-trend.up { color: var(--paid); }
.rep-stats-row { display: flex; gap: 24px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.rep-stat { display: flex; flex-direction: column; gap: 2px; }
.rs-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.rs-val { font-size: 1rem; font-weight: 700; }
.rs-val.col { color: var(--paid); }
.rs-val.warn { color: var(--overdue); }

/* Bar chart */
.rep-bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 80px; }
.rb-label { font-size: 0.65rem; color: var(--muted); text-align: center; margin-top: 4px; width: 100%; }
.rb-bar { flex: 1; height: var(--h); background: var(--border); border-radius: 4px 4px 0 0; transition: height 0.4s; }
.rb-bar.active { background: var(--accent); }

/* === PRICING === */
.pricing { background: var(--bg); }
.pricing-inner { max-width: var(--max-w); margin: 0 auto; }
.pricing-sub { font-size: 1rem; color: var(--muted); margin-bottom: 48px; }
.pricing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 40px; }
.price-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; padding: 36px; position: relative; }
.price-card-pro { border: 2px solid var(--teal); }
.pc-pro-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--teal); color: white; font-size: 0.72rem; font-weight: 600; padding: 4px 16px; border-radius: 20px; white-space: nowrap; }
.pc-tier { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--teal); margin-bottom: 16px; }
.pc-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.pc-amount { font-family: var(--font-display); font-size: 3rem; font-weight: 800; color: var(--teal); }
.pc-per { font-size: 0.9rem; color: var(--muted); }
.pc-desc { font-size: 0.9rem; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
.pc-features { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.pc-features li { font-size: 0.88rem; padding-left: 20px; position: relative; color: var(--fg); }
.pc-features li::before { content: ''; position: absolute; left: 0; top: 7px; width: 12px; height: 12px; background: var(--accent); border-radius: 3px; opacity: 0.8; }
.pc-note { font-size: 0.78rem; color: var(--muted); margin-top: 8px; text-align: center; }
.btn-primary { display: inline-block; background: var(--teal); color: white; font-weight: 600; font-size: 0.9rem; padding: 12px 28px; border-radius: 10px; transition: background 0.2s; }
.btn-primary:hover { background: var(--teal-mid); }
.btn-secondary { display: inline-block; background: transparent; color: var(--teal); font-weight: 600; font-size: 0.9rem; padding: 12px 28px; border-radius: 10px; border: 1.5px solid var(--teal); transition: all 0.2s; }
.btn-secondary:hover { background: var(--teal); color: white; }
.pc-cta { text-align: center; }

/* API strip */
.api-strip { background: var(--teal); border-radius: 16px; padding: 28px 36px; }
.api-strip-inner { display: flex; align-items: center; justify-content: space-between; }
.api-left { display: flex; align-items: center; gap: 20px; }
.api-icon { width: 44px; height: 44px; background: rgba(255,255,255,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.api-left strong { font-size: 0.95rem; color: white; display: block; margin-bottom: 2px; }
.api-left p { font-size: 0.82rem; color: rgba(255,255,255,0.6); max-width: 400px; }
.api-link { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--accent); white-space: nowrap; }
.api-link:hover { color: #FBBF24; }

/* === CLOSING === */
.closing { background: var(--teal); color: white; text-align: center; }
.closing-inner { max-width: 760px; margin: 0 auto; }
.closing-badge { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 24px; }
.closing-headline { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.2; margin-bottom: 24px; color: white; }
.closing-sub { font-size: 1rem; color: rgba(255,255,255,0.6); line-height: 1.7; margin-bottom: 48px; }
.closing-stats { display: flex; justify-content: center; align-items: center; gap: 40px; margin-bottom: 40px; }
.c-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cs-num { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; color: var(--accent); }
.cs-label { font-size: 0.8rem; color: rgba(255,255,255,0.5); max-width: 160px; text-align: center; line-height: 1.4; }
.c-divider { width: 1px; height: 48px; background: rgba(255,255,255,0.15); }
.closing-tagline { font-size: 1rem; color: rgba(255,255,255,0.7); }

/* === FOOTER === */
.footer { background: var(--teal); color: rgba(255,255,255,0.5); padding: 32px var(--pad-x); }
.footer-inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 500; color: white; }
.footer-by { font-size: 0.78rem; color: rgba(255,255,255,0.4); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 0.82rem; color: rgba(255,255,255,0.5); }
.footer-links a:hover { color: white; }
.footer-copy { font-size: 0.78rem; color: rgba(255,255,255,0.3); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .hero-inner, .ip-inner, .rep-inner { grid-template-columns: 1fr; gap: 40px; }
  .features-grid { grid-template-columns: 1fr; }
  .feat-card.feat-primary { grid-column: span 1; grid-template-columns: 1fr; }
  .pricing-cards { grid-template-columns: 1fr; }
  .closing-stats { flex-direction: column; gap: 24px; }
  .c-divider { width: 40px; height: 1px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .api-strip-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .nav-links { display: none; }
}

@media (max-width: 480px) {
  :root { --pad-x: 20px; }
  .hero-headline { font-size: 2.2rem; }
  .inv-card { padding: 20px; }
}