.process-flow-container {
  width: 100%;
  max-width: 1200px;
  margin: 40px auto;
  font-family: 'Segoe UI', Arial, sans-serif;
  position: relative;
  padding: 20px;
}

.process-flow-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 500;
  margin-bottom: 40px;
  color: #333;
}

/* STEPS GRID LAYOUT */
.process-flow-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 60px 40px;
  position: relative;
  width: 100%;
  margin-top: 40px;
}

/* Step cards */
.process-flow-step-box {
  background: #fff;
  width: 100%;
  min-height: 180px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.09);
  position: relative;
  padding: 36px 26px 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 3;
  transition: all 0.3s ease;
}

/* Horizontal connectors using HTML elements */
.connector-horizontal {
  position: absolute;
  top: 50%;
  right: -50px;
  width: 40px;
  height: 3px;
  background: #ddd;
  z-index: 1;
  transform: translateY(-50%);
}

.connector-horizontal::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -3px;
  width: 0;
  height: 0;
  border-left: 8px solid #ddd;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  z-index: 2;
  transform: translateY(-50%);
}

/* Vertical connector for card 4 */
.connector-vertical {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 3px;
  height: 60px;
  background: #ddd;
  z-index: 1;
  transform: translateX(-50%);
}

.connector-vertical::after {
  content: '';
  position: absolute;
  top: calc(100% - 3px);
  left: 50%;
  width: 0;
  height: 0;
  border-top: 8px solid #ddd;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  z-index: 2;
  transform: translateX(-50%);
}

/* Remove old pseudo-element rules */

/* Step numbering and styling */
.process-flow-step-box .step-number {
  position: absolute;
  top: -17px;
  left: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fcb900;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 10; /* Increased z-index to ensure it's on top */
}

.process-flow-step-box:nth-child(1) .step-number { background: #fcb900; }
.process-flow-step-box:nth-child(2) .step-number { background: #00b6bd; }
.process-flow-step-box:nth-child(3) .step-number { background: #f95e5a; }
.process-flow-step-box:nth-child(4) .step-number { background: #a12d7d; }
.process-flow-step-box:nth-child(5) .step-number { background: #fcb900; }
.process-flow-step-box:nth-child(6) .step-number { background: #00b6bd; }
.process-flow-step-box:nth-child(7) .step-number { background: #f95e5a; }
.process-flow-step-box:nth-child(8) .step-number { background: #a12d7d; }

.process-flow-step-box .step-title {
  font-weight: 700;
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: #333;
  margin-top: 10px;
}

.process-flow-step-box .step-desc {
  color: #666;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* Hover effects */
.process-flow-step-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

/* Use separate element for corner accent to avoid pseudo-element conflicts */
.process-flow-step-box {
  overflow: visible; /* Changed from hidden to visible for better number visibility */
}

.process-flow-step-box .step-corner-accent {
  position: absolute;
  width: 50px;
  height: 18px;
  border-radius: 0 14px 0 0;
  top: 0;
  left: 0;
  z-index: 1; /* Lower z-index than step number */
}

.process-flow-step-box:nth-child(1) .step-corner-accent { background: #fcb900; }
.process-flow-step-box:nth-child(2) .step-corner-accent { background: #00b6bd; }
.process-flow-step-box:nth-child(3) .step-corner-accent { background: #f95e5a; }
.process-flow-step-box:nth-child(4) .step-corner-accent { background: #a12d7d; }
.process-flow-step-box:nth-child(5) .step-corner-accent { background: #fcb900; }
.process-flow-step-box:nth-child(6) .step-corner-accent { background: #00b6bd; }
.process-flow-step-box:nth-child(7) .step-corner-accent { background: #f95e5a; }
.process-flow-step-box:nth-child(8) .step-corner-accent { background: #a12d7d; }

/* Responsive Design */
@media (max-width: 1024px) {
  .process-flow-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 50px 30px;
  }
  
  .process-flow-step-box:nth-child(3):not(:last-child)::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 3px;
    height: 50px;
    background: #ddd;
    z-index: 1;
    transform: translateX(-50%);
  }

  .process-flow-step-box:nth-child(3):not(:last-child)::before {
    content: '';
    position: absolute;
    top: calc(100% + 47px);
    left: 50%;
    width: 0;
    height: 0;
    border-top: 8px solid #ddd;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    z-index: 2;
    transform: translateX(-50%);
  }

  .process-flow-step-box:nth-child(4)::after,
  .process-flow-step-box:nth-child(4)::before {
    display: none;
  }
}

@media (max-width: 768px) {
  .process-flow-container {
    padding: 20px 10px;
  }
  
  .process-flow-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }
  
  .process-flow-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 20px;
  }
  
  .process-flow-step-box {
    min-height: 160px;
    padding: 30px 20px 24px 20px;
  }
  
  .process-flow-step-box .step-title {
    font-size: 1.4rem;
  }
  
  .process-flow-step-box .step-desc {
    font-size: 1rem;
  }

  .process-flow-step-box:nth-child(2n):not(:last-child)::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 3px;
    height: 40px;
    background: #ddd;
    z-index: 1;
    transform: translateX(-50%);
  }

  .process-flow-step-box:nth-child(2n):not(:last-child)::before {
    content: '';
    position: absolute;
    top: calc(100% + 37px);
    left: 50%;
    width: 0;
    height: 0;
    border-top: 8px solid #ddd;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    z-index: 2;
    transform: translateX(-50%);
  }

  .process-flow-step-box:nth-child(3)::after,
  .process-flow-step-box:nth-child(3)::before,
  .process-flow-step-box:nth-child(4)::after,
  .process-flow-step-box:nth-child(4)::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .process-flow-steps {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .process-flow-step-box:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 3px;
    height: 30px;
    background: #ddd;
    z-index: 1;
    transform: translateX(-50%);
  }

  .process-flow-step-box:not(:last-child)::before {
    content: '';
    position: absolute;
    top: calc(100% + 27px);
    left: 50%;
    width: 0;
    height: 0;
    border-top: 8px solid #ddd;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    z-index: 2;
    transform: translateX(-50%);
  }

  .process-flow-step-box:nth-child(2n)::after,
  .process-flow-step-box:nth-child(2n)::before,
  .process-flow-step-box:nth-child(3)::after,
  .process-flow-step-box:nth-child(3)::before,
  .process-flow-step-box:nth-child(4)::after,
  .process-flow-step-box:nth-child(4)::before {
    display: none;
  }
}