/* How It Works */
.how-it-works {
  padding: 5rem 2rem;
  background: var(--gradient-subtle);
}

.section-container {
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-badge {
  display: inline-block;
  background: var(--gradient-gold);
  color: var(--primary-dark);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 800;
}

.section-header p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Steps Container - Desktop (4 columns) */
.steps-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 326px));
  gap: 2rem;
  padding: 2rem 0;
  position: relative;
  justify-content: center;
  align-items: stretch; /* Add this */
}

.step-card {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 326px;
  height: 100%; /* Add this */
}

.step-number {
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  color: var(--text-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(27, 29, 78, 0.3);
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
  margin-bottom: 1.5rem;
}

/* Connector line between circles - only for desktop 4-column layout */
.step-connector {
  display: none;
}

@media (min-width: 1024px) {
  .step-card:not(:last-child) .step-connector {
    display: block;
    position: absolute;
    top: 40px;
    left: calc(50% + 40px);
    width: calc(100% - 80px);
    right: -2rem; /* Symmetric spacing - uses the gap value */
    height: 2px;
    background: var(--gradient-primary);
    z-index: 1;
  }
}

.step-card:hover .step-number {
  transform: scale(1.1);
}

.step-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  width: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1; /* Add this - makes content expand to fill available space */
}

.step-card:hover .step-content {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-gold);
}

.step-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.step-description {
  color: var(--text-secondary);
  line-height: 1.6;
  flex-grow: 1;
}

/* Tablet - 2x2 grid */
@media (min-width: 768px) and (max-width: 1023px) {
  .steps-container {
    grid-template-columns: repeat(2, minmax(0, 326px));
    gap: 3rem;
    align-items: stretch; /* Add this */
  }

  /* Hide connectors in 2x2 layout */
  .step-connector {
    display: none !important;
  }
}

/* Mobile - 1 column */
@media (max-width: 767px) {
  .steps-container {
    grid-template-columns: minmax(0, 326px);
    gap: 2.5rem;
    justify-content: center;
  }

  .step-connector {
    display: none !important;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .section-header p {
    font-size: 1rem;
  }

  .step-number {
    width: 70px;
    height: 70px;
    font-size: 1.25rem;
  }

  .step-content {
    min-height: auto;
  }
}

/* Extra small mobile */
@media (max-width: 374px) {
  .steps-container {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
  }

  .step-card {
    max-width: 100%;
  }
}

/* Animation classes */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger animation for step cards */
.step-card:nth-child(1) {
  transition-delay: 0.1s;
}

.step-card:nth-child(2) {
  transition-delay: 0.2s;
}

.step-card:nth-child(3) {
  transition-delay: 0.3s;
}

.step-card:nth-child(4) {
  transition-delay: 0.4s;
}
