/* ==========================================================================
   Section: education-method
   Flujo editorial de cinco pasos con cards de dos caras (flip sobrio).
   ========================================================================== */

.fx-education-method__flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--fx-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Card: altura uniforme por fila (grid stretch). */
.fx-education-method__step {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--fx-space-6);
  border: 1px solid var(--fx-color-line);
  background: var(--fx-color-surface-high);
  transform-style: preserve-3d;
  transition: transform 900ms var(--fx-ease-standard);
}

.fx-education-method__step.is-flipped {
  transform: perspective(1100px) rotateY(180deg);
}

.fx-education-method__step:hover {
  border-color: var(--fx-color-primary);
}

/* Contenedor flip: el frente fluye y da la altura; el reverso lo cubre. */
.fx-education-method__front,
.fx-education-method__back {
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.fx-education-method__front {
  flex: 1 0 auto;
}

.fx-education-method__back {
  position: absolute;
  inset: 0;
  padding: var(--fx-space-6);
  background: var(--fx-color-surface-high);
  border: 1px solid var(--fx-color-primary);
  transform: rotateY(180deg);
}

/* HEADER del frente */
.fx-education-method__step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--fx-space-2);
  padding-bottom: var(--fx-space-3);
  border-bottom: 1px solid var(--fx-color-line-strong);
}

.fx-education-method__step-number {
  color: var(--fx-color-primary-deep);
  font-size: var(--fx-text-h2);
  font-weight: 600;
  line-height: 1;
}

.fx-education-method__step-label {
  color: var(--fx-color-carbon);
  text-align: right;
}

.fx-education-method__step-title {
  margin-top: var(--fx-space-4);
  margin-bottom: var(--fx-space-2);
}

.fx-education-method__step-text {
  margin-bottom: 0;
}

/* Footer: indicador de progreso + señal de interacción */
.fx-education-method__step-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fx-space-3);
  margin-top: auto;
  padding-top: var(--fx-space-4);
}

.fx-education-method__step-next {
  color: var(--fx-color-outline);
}

.fx-education-method__step-done {
  color: var(--fx-color-success);
  font-weight: 600;
}

/* Señal discreta: abre el reverso */
.fx-education-method__view {
  display: inline-flex;
  align-items: center;
  gap: var(--fx-space-2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--fx-color-primary);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

.fx-education-method__view:hover {
  color: var(--fx-color-primary-deep);
}

.fx-education-method__view:focus-visible,
.fx-education-method__back-btn:focus-visible {
  outline: 2px solid var(--fx-focus-color);
  outline-offset: var(--fx-focus-offset);
}

.fx-education-method__view-arrow {
  font-weight: 600;
}

/* Reverso: segunda capa sobre superficie clara, identidad vía Primary. */
.fx-education-method__back-head {
  display: flex;
  align-items: flex-start;
  gap: var(--fx-space-2);
}

.fx-education-method__back-marker {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: calc((var(--fx-leading-body) - 1em) / 2);
  background: var(--fx-color-primary);
}

.fx-education-method__back-title {
  margin: 0 0 var(--fx-space-3);
  color: var(--fx-color-carbon);
  font-size: var(--fx-text-body);
  line-height: var(--fx-leading-body);
}

.fx-education-method__back-block {
  display: grid;
  gap: var(--fx-space-1);
  margin-bottom: var(--fx-space-2);
}

.fx-education-method__back-label {
  color: var(--fx-color-primary);
  font-weight: 600;
}

.fx-education-method__back-question {
  margin-bottom: 0;
  color: var(--fx-color-text);
  font-weight: 500;
}

.fx-education-method__back-micro {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--fx-color-text-secondary);
}

.fx-education-method__back-close {
  margin-top: var(--fx-space-3);
  margin-bottom: 0;
  color: var(--fx-color-success);
  font-weight: 600;
}

.fx-education-method__back .fx-education-method__step-foot {
  margin-top: auto;
  padding-top: var(--fx-space-3);
  justify-content: flex-end;
}

.fx-education-method__back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--fx-space-2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--fx-color-primary-deep);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

.fx-education-method__back-btn:hover {
  color: var(--fx-color-primary);
}

/* Reduced motion: intercambio directo sin giro 3D (funcionalidad intacta). */
@media (prefers-reduced-motion: reduce) {
  .fx-education-method__step {
    transition: none;
  }

  .fx-education-method__front.is-hidden {
    display: none;
  }

  .fx-education-method__back {
    display: none;
  }

  .fx-education-method__back.is-shown {
    display: flex;
    position: static;
    transform: none;
  }
}

@media (max-width: 1199px) {
  .fx-education-method__flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .fx-education-method__flow {
    grid-template-columns: 1fr;
  }
}