/* ==========================================================================
   Matatu ERP page (https://trimline.co.ke/matatu)
   Loaded after home-modern.css
   ========================================================================== */

.matatu-hero {
  padding-bottom: 4rem;
}

/* Hero module map */
.erp-map {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
}

.erp-map-hub {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(150deg, #071c2f 0%, #0a3556 55%, #0b6bcb 140%);
  color: #fff;
  box-shadow: 0 18px 40px -22px rgba(6, 33, 58, 0.55);
}

.erp-map-mark {
  display: grid;
  place-items: center;
  padding: 0.35rem 0.45rem;
  border-radius: 10px;
  background: #fff;
  flex-shrink: 0;
}

.erp-map-mark img {
  display: block;
  height: 34px;
  width: auto;
}

.erp-map-hub strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.erp-map-hub span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.erp-map-line {
  height: 26px;
  width: 0;
  margin: 0 auto;
  border-left: 2px dashed rgba(11, 107, 203, 0.35);
}

.erp-map-nodes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.erp-map-node {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: #f7fbff;
  border: 1px solid var(--line);
}

.erp-map-node i {
  margin-bottom: 0.3rem;
  color: var(--brand);
  font-size: 0.95rem;
}

.erp-map-node strong {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.erp-map-node span {
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--slate);
}

.erp-map-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-deep);
}

/* Module deep-dives */
.module-block {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
  padding: 2.6rem 0;
  border-top: 1px solid var(--line);
}

.module-block:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.module-block.reverse .module-copy {
  order: 2;
}

.module-block.reverse .module-visual {
  order: 1;
}

.module-copy h3 {
  margin: 0.55rem 0 0.7rem;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.module-copy > p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--slate);
}

.module-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}

.module-list li {
  display: flex;
  gap: 0.7rem;
}

.module-list .tick {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(15, 163, 107, 0.12);
  color: var(--mint);
  font-size: 0.62rem;
  flex-shrink: 0;
}

.module-list strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.module-list span {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--slate);
}

.module-visual {
  position: relative;
  display: grid;
  place-items: center;
  gap: 1.1rem;
  min-height: 300px;
  padding: 2rem;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(9, 38, 63, 0.1);
  box-shadow: var(--shadow-lift);
}

.module-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.28), transparent 42%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.16), transparent 60%);
  pointer-events: none;
}

.visual-sacco {
  background: linear-gradient(155deg, #0b4f86 0%, #0b6bcb 55%, #39b7ff 140%);
}

.visual-ops {
  background: linear-gradient(155deg, #063b2f 0%, #0b6b52 55%, #12b886 140%);
}

.visual-parcel {
  background: linear-gradient(155deg, #0a2a4d 0%, #144a86 55%, #2f8bd8 140%);
}

.visual-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 1.7rem;
}

.visual-chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.visual-chips span {
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

/* Waybill sub-feature (Operations) */
.waybill-panel {
  margin-top: 2.2rem;
  padding: 2rem;
  border-radius: 26px;
  background:
    radial-gradient(620px 320px at 92% 0%, rgba(57, 183, 255, 0.14), transparent 66%),
    #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.waybill-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.4rem;
  margin-bottom: 1.6rem;
}

.waybill-head > div {
  flex: 1 1 480px;
}

.waybill-head h4 {
  margin: 0.6rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.waybill-head p {
  max-width: 72ch;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--slate);
}

.waybill-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.waybill-flow span {
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  background: rgba(11, 107, 203, 0.08);
  border: 1px solid rgba(11, 107, 203, 0.16);
}

.waybill-flow i {
  font-size: 0.58rem;
  color: #9bb3c9;
}

.waybill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.waybill-item {
  padding: 1.1rem;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
}

.waybill-item > i {
  color: var(--brand);
  font-size: 1rem;
}

.waybill-item h5 {
  margin: 0.55rem 0 0.3rem;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.waybill-item p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--slate);
}

/* Fund separation */
.separation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: stretch;
}

.sep-card {
  padding: 1.5rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.sep-card header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.sep-card header .icon-tile {
  width: 36px;
  height: 36px;
  margin: 0;
  font-size: 0.85rem;
}

.sep-card ul {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sep-card li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.87rem;
  line-height: 1.5;
  color: var(--slate);
}

.sep-card li i {
  margin-top: 0.35rem;
  font-size: 0.62rem;
  color: var(--mint);
}

.sep-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 100px;
  padding: 0 0.4rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--brand-deep);
}

.sep-divider::before,
.sep-divider::after {
  content: '';
  width: 0;
  flex: 1;
  border-left: 2px dashed rgba(11, 107, 203, 0.3);
}

.sep-shield {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(11, 107, 203, 0.1);
  border: 1px solid rgba(11, 107, 203, 0.2);
  color: var(--brand);
  font-size: 1rem;
}

.sep-note {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  max-width: 820px;
  margin: 1.2rem auto 0;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--slate);
}

.sep-note i {
  margin-top: 0.2rem;
  color: var(--brand);
}

.sep-note p {
  margin: 0;
}

.sep-note strong {
  color: var(--ink);
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.step {
  position: relative;
  padding: 1.4rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(7, 26, 43, 0.03);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 0.8rem;
  border-radius: 10px;
  background: rgba(11, 107, 203, 0.1);
  border: 1px solid rgba(11, 107, 203, 0.16);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-deep);
}

.step h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.step p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--slate);
}

/* Analytics */
.analytics-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.6rem;
  align-items: center;
}

.analytics-media {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(9, 38, 63, 0.12);
  background: #0b1220;
  box-shadow: var(--shadow-lift);
}

.analytics-media img {
  display: block;
  width: 100%;
  height: auto;
}

.analytics-copy h3 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.analytics-copy > p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--slate);
}

/* Integrations */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.integration {
  padding: 1.4rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(7, 26, 43, 0.03);
}

.integration h3 {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.integration p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--slate);
}

/* Benefits */
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.benefit {
  padding: 1.4rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(7, 26, 43, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.benefit:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(11, 107, 203, 0.24);
}

.benefit h3 {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.benefit p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--slate);
}

/* Audience */
.audience-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.audience {
  padding: 1.5rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(7, 26, 43, 0.03);
}

.audience h3 {
  margin: 0.2rem 0 0.4rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.audience p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--slate);
}

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

  .integration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .benefit-grid,
  .audience-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .module-block,
  .module-block.reverse {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .module-block.reverse .module-copy,
  .module-block.reverse .module-visual {
    order: 0;
  }

  .module-visual {
    min-height: 230px;
    padding: 1.6rem;
  }

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

  .analytics-grid {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .waybill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sep-divider {
    flex-direction: row;
    min-width: 0;
    padding: 0.3rem 0;
  }

  .sep-divider::before,
  .sep-divider::after {
    width: auto;
    height: 0;
    flex: 1;
    border-left: 0;
    border-top: 2px dashed rgba(11, 107, 203, 0.3);
  }
}

@media (max-width: 680px) {
  .erp-map {
    padding: 1.1rem;
  }

  .erp-map-nodes {
    grid-template-columns: 1fr;
  }

  .erp-map-line {
    height: 18px;
  }

  .steps,
  .integration-grid,
  .benefit-grid,
  .audience-grid {
    grid-template-columns: 1fr;
  }

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

  .waybill-panel {
    padding: 1.4rem;
  }
}
