.fb-ai-stages {
  --fb-blue: #0AF;
  --fb-navy: #0d3754;
  --fb-body: #36434c;
  --fb-border: #f0f0f0;
  --fb-white: #ffffff;
  --fb-max: 1240px;
  --fb-gap: 24px;
  --fb-card-pad-y: 32px;
  --fb-card-pad-x: 24px;
  --fb-radius: 25px;
  --fb-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --fb-inactive-veil: 0.28;

  box-sizing: border-box;
  background: var(--fb-white);
  width: 100%;
  color: var(--fb-body);
  font-family: "Open Sans", sans-serif;
}

.fb-ai-stages *,
.fb-ai-stages *::before,
.fb-ai-stages *::after {
  box-sizing: border-box;
}

.fb-ai-stages__inner {
  max-width: var(--fb-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Stepper */
.fb-ai-stages__stepper {
  position: relative;
  width: 100%;
  max-width: 1240px;
  height: 71px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(100% / 6);
}

.fb-ai-stages__stepper-track {
  position: absolute;
  left: calc(100% / 6);
  right: calc(100% / 6);
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: #d9e2e8;
  border-radius: 2px;
  overflow: hidden;
  z-index: 0;
}

.fb-ai-stages__stepper-fill {
  height: 100%;
  width: 0%;
  background: var(--fb-blue);
  transition: width var(--fb-transition);
}

.fb-ai-stages__step {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--fb-blue);
  background: var(--fb-white);
  color: var(--fb-blue);
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background var(--fb-transition), color var(--fb-transition), box-shadow var(--fb-transition), transform var(--fb-transition);
}

.fb-ai-stages__step.is-done,
.fb-ai-stages__step.is-active {
  background: var(--fb-blue);
  color: var(--fb-white);
}

.fb-ai-stages__step.is-active {
  box-shadow: 0 0 0 10px rgba(0, 170, 255, 0.22);
  transform: scale(1.05);
}

/* Cards */
.fb-ai-stages__cards {
  display: flex;
  align-items: flex-start;
  gap: var(--fb-gap);
  width: 100%;
}

.fb-ai-stages__card {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: var(--fb-card-pad-y) var(--fb-card-pad-x);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  background: var(--fb-white);
  transition: border-color var(--fb-transition), box-shadow var(--fb-transition);
}

.fb-ai-stages__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, var(--fb-inactive-veil));
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  transition: opacity var(--fb-transition);
}

.fb-ai-stages__card.is-active {
  border-color: var(--fb-blue);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.fb-ai-stages__card.is-active::after {
  opacity: 0;
}

.fb-ai-stages__kicker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-ai-stages__num {
  display: none;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--fb-blue);
  color: var(--fb-white);
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  align-items: center;
  justify-content: center;
}

.fb-ai-stages__label {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  color: var(--fb-blue);
  text-transform: uppercase;
}

.fb-ai-stages__card-title {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 32px;
  letter-spacing: 0.08px;
  color: var(--fb-navy);
  text-align: left;
}

.fb-ai-stages__videos {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.fb-ai-stages__video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2000 / 1190;
  background: #fff;
}

.fb-ai-stages__video-wrap video {
  /* Hidden until a real frame exists — full-size <video> paints black on reload. */
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  max-width: none;
  opacity: 0;
  display: block;
  background: #fff;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

.fb-ai-stages__video-wrap.is-ready video {
  position: static;
  width: 100%;
  height: auto;
  max-width: 100%;
  opacity: 1;
  pointer-events: auto;
}

.fb-ai-stages__canvas {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  pointer-events: none;
  z-index: 1;
  background: #fff;
}

/* Chrome HW overlay: keep the source tiny even after is-ready. */
.fb-ai-stages--canvas .fb-ai-stages__video-wrap {
  overflow: hidden;
  isolation: isolate;
}

.fb-ai-stages--canvas .fb-ai-stages__video-wrap video,
.fb-ai-stages--canvas .fb-ai-stages__video-wrap.is-ready video {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  max-width: none;
  opacity: 0;
  pointer-events: none;
}

.fb-ai-stages__card-copy *{
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.064px;
  color: var(--fb-body);
}

@media (max-width: 1100px) {

  .fb-ai-stages__stepper {
    padding: 0 24px;
    height: 56px;
  }

  .fb-ai-stages__stepper-track {
    left: 24px;
    right: 24px;
  }

  .fb-ai-stages__step {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .fb-ai-stages__step.is-active {
    box-shadow: 0 0 0 8px rgba(0, 170, 255, 0.22);
  }

  .fb-ai-stages__cards {
    flex-direction: column;
  }

  .fb-ai-stages__card {
    flex: none;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
  }
}

@media (max-width: 767px) {
  .fb-ai-stages__stepper {
    display: none;
  }

  .fb-ai-stages__num {
    display: flex;
  }

  .fb-ai-stages__card,
  .fb-ai-stages__card.is-active {
    border-color: var(--fb-border);
    box-shadow: none;
  }

  .fb-ai-stages__card::after,
  .fb-ai-stages__card.is-active::after {
    display: none;
  }
}
