/* ========================================
   ANIMACIONES
======================================== */

@keyframes pop {
  from {
    opacity: 0;
    translate: 0 -10px;
    scale: .98;
  }

  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

/* ========================================
   ENCABEZADO Y ESTADOS
======================================== */

.convocatorias-linea-tiempo .header > span {
  color: var(--SECUNDARIO);
  font-weight: 500;
}

.convocatorias-linea-tiempo .header .fs-4 {
  color: var(--ColorTitulos);
}

.linea-estados .estado {
  width: 100%;
}

/* ========================================
   LÍNEA DE TIEMPO - STEPPER
======================================== */

.stepper-wrapper {
  width: 100%;
  margin: 0 auto;
  padding: 30px 0;
}

.stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

/* Línea conectora */

.stepper::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 12%;
  right: 12%;
  height: 4px;
  background-color: #cbd5e1;
  z-index: -1;
}

.step {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Círculos */

.step-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 48px;
  height: 48px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background-color: #fff;
  color: #64748b;
  font-size: 1.1rem;
  font-weight: 700;
  transition: all .3s ease;
}

/* Etapa completada */

.step.completed .step-circle {
  background-color: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

/* Etapa actual */

.step.current .step-circle {
  background-color: #1e3a8a;
  border-color: #1e3a8a;
  color: #fff;
  box-shadow: 0 0 0 8px rgba(59, 130, 246, .2);
}

/* Indicador de etapa actual */

.badge-current {
  position: absolute;
  top: -42px;
  padding: 4px 12px;
  border-radius: 50rem;
  background-color: var(--SECUNDARIO);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

.badge-current::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  background-color: var(--SECUNDARIO);
  transform: translateX(-50%) rotate(45deg);
}

/* Etiquetas */

.step-label {
  max-width: 130px;
  margin-top: 12px;
  color: #1e293b;
  font-size: .95rem;
  font-weight: 600;
  text-align: center;
}

.step.pending .step-label {
  color: #64748b;
}

/* ========================================
   TARJETA DE DETALLE
======================================== */

#tcard-container {
  position: relative;
  width: 100%;
  margin:2rem 0;
}

.tcard {
  --x: 50%;

  display: flex;
  align-items: flex-start;
  position: relative;
  gap: 18px;
  margin: .5rem 0;
  padding: 22px 24px 24px;
  border: 2px solid #d3dceb;
  border-radius: 16px;
  background-color: #f5f8fc;
  box-shadow: 0 6px 22px rgba(11, 40, 80, .10);
  animation: pop .3s cubic-bezier(.3, 1.4, .5, 1);
}

/* Indicador superior */

.tcard::before {
  content: "";
  position: absolute;
  top: -10px;
  left: clamp(12px, var(--x), calc(100% - 12px));
  z-index: 1;
  width: 18px;
  height: 18px;
  border-top: 2px solid #dce5eb;
  border-left: 2px solid #dce5eb;
  background-color: #f5f8fc;
  transform: translateX(-50%) rotate(45deg);
}

/* Etapa actual */

.tcard.current,
.tcard.current::before {
  border-color: var(--SECUNDARIO);
}

/* Botón cerrar */

.tcard .x2 {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background-color: #d3dceb;
  color: #1b2b3f;
  font-size: 1.2rem;
  line-height: 1;
}

/* Ícono */

.tcard .tc-ic {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #e7f0f8;
  color: var(--PRINCIPAL);
  font-size: 30px;
}

/* Contenido */

.tcard .tc-tx {
  flex: 1;
  padding-right: 20%;
}

.tcard .eyebrow {
  margin-bottom: 6px;
  color: var(--PRINCIPAL);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tcard h4 {
  margin-bottom: 10px;
  color: #2d3a47;
  font-size: 20px;
  font-weight: 700;
}

.tcard .tc-tx p:last-child {
  margin-bottom: 0;
  color: #495866;
  font-size: 15px;
  line-height: 1.6;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
	
	.stepper-wrapper {
  padding: 0;
}

  /* Stepper vertical */

  .stepper {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 0;
  }

  .stepper::before {
    top: 10px;
    bottom: 10px;
    left: 23px;
    right: auto;
    width: 4px;
    height: auto;
  }

  .step {
    flex: none;
    flex-direction: row;
    align-items: center;
    margin-bottom: 28px;
  }
  .step:last-child{
  	margin-bottom: 0;
  }

  .step-label {
    max-width: 100%;
    margin: 0 0 0 16px;
    text-align: left;
  }

  .badge-current {
    top: -30px;
    left: 0;
  }

  /* Tarjeta */

  .tcard {
    gap: 12px;
    padding: 20px 16px;
  }

  .tcard .tc-ic {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .tcard h4 {
    font-size: 17px;
  }

  .tcard .tc-tx p:last-child {
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .tcard .tc-tx {
    padding-right: 5%;
  }
}

/* ========================================
   ACCESIBILIDAD
======================================== */

@media (prefers-reduced-motion: reduce) {
  .step-circle {
    transition: none;
  }

  .tcard {
    animation: none;
  }
}
