/* ========== BUSCAR EGRESADO CSS - PROFESIONAL ========== */

/* Estilos para el formulario de búsqueda - SE MANTIENE IGUAL */
#buscarEgresadoSection .form-control-lg {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 16px;
  transition: all 0.3s ease;
}

#buscarEgresadoSection .form-control-lg:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(255, 214, 138, 0.25);
}

#buscarEgresadoSection .form-label {
  color: var(--dark);
  font-family: 'Oswald', sans-serif;
  margin-bottom: 8px;
}

/* ========== CAPTCHA PROFESIONAL ========== */
#captchaContainer {
  background: #f8f9fa;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 20px;
}

#captchaContainer label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  margin-bottom: 10px;
  display: block;
}

#captchaDisplay {
  background: linear-gradient(45deg, #f1f1f1, #e9e9e9);
  border: 2px solid #ddd;
  padding: 12px 20px;
  border-radius: 6px;
  display: inline-block;
  margin: 10px;
}

#captchaCode {
  font-family: 'Courier New', monospace;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  letter-spacing: 4px;
  user-select: none;
}

#refreshCaptcha {
  background: var(--primary);
  border: none;
  color: var(--dark);
  padding: 8px 12px;
  border-radius: 4px;
  margin-left: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#refreshCaptcha:hover {
  background: #ffeaaf;
  transform: scale(1.05);
}

#captchaInput {
  /* No cambia borde ni fondo nunca */
  border-color: #e0e0e0;
  background: #fff;
  transition: none;
}

.position-relative {
    position: relative;
}

#captchaStatusIcon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.38s;
    z-index: 2;
    display: flex;
    align-items: center;
}

#captchaStatusIcon.fade-in {
    opacity: 1;
}

/* ========== RESULTADOS PROFESIONALES COMO SUNEDU ========== */
#resultadosSection {
  margin-top: 40px;
  margin-bottom: 0 !important;
}

#resultadoCard {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 30px;
}

#headerResultado {
  background: #003f7f;
  color: white;
  padding: 18px 25px;
  font-weight: 700;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 22px;
  letter-spacing: 1px;
}

#datosEgresado {
  padding: 30px;
}

/* ========== PERFIL EGRESADO ========== */
#perfilEgresado {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 2px solid #f0f0f0;
}

#fotoEgresado {
  width: 170px;
  height: 115px;
  border-radius: 8px;
  object-fit: cover;
  border: 3px solid #003f7f;
  margin-right: 25px;
  flex-shrink: 0;
}

#fotoFallback {
  width: 170px;
  height: 115px;
  border-radius: 8px;
  background: #003f7f;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: bold;
  margin-right: 25px;
  flex-shrink: 0;
}

#nombreEgresado {
  font-size: 24px;
  font-weight: 700;
  color: #003f7f;
  margin-bottom: 8px;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
}

#dniEgresado {
  color: #666;
  font-size: 16px;
  font-weight: 600;
  background: #f8f9fa;
  padding: 4px 12px;
  border-radius: 4px;
  display: inline-block;
}

/* ========== CERTIFICACIONES VERTICALES ========== */
#certificacionesContainer {
  margin-bottom: 25px;
}

.certificacion-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  position: relative;
  background: #fff;
}

.certificacion-principal {
  border-left: 5px solid #003f7f;
  background: linear-gradient(90deg, #f8f9ff 0%, #fff 100%);
}

.certificacion-especializacion {
  border-left: 5px solid #28a745;
  background: linear-gradient(90deg, #f8fff8 0%, #fff 100%);
}

.cert-tipo {
  background: #003f7f;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.cert-tipo.especializacion {
  background: #28a745;
}

.cert-titulo {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.3;
}

.cert-año {
  background: #6c757d;
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
  position: absolute;
  top: 20px;
  right: 20px;
}

.cert-año.principal {
  background: #003f7f;
}

.cert-año.especializacion {
  background: #28a745;
}

/* ========== INFO ADICIONAL ========== */
#infoAdicional {
  background: #f8f9fa;
  padding: 25px;
  border-top: 2px solid #e9ecef;
  border-radius: 0 0 8px 8px;
}

.info-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item i {
  color: #003f7f;
  width: 25px;
  margin-right: 12px;
  text-align: center;
}

.info-item strong {
  color: #333;
  margin-right: 8px;
}

/* ========== NO RESULTADOS ========== */
#noResultados {
  text-align: center;
  padding: 50px 30px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 30px;
}

#noResultados i {
  color: #ccc;
  font-size: 64px;
  margin-bottom: 25px;
}

#noResultados h4 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  color: #666;
  margin-bottom: 15px;
}

#noResultados p {
  color: #888;
  font-size: 16px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  #perfilEgresado {
    flex-direction: column;
    text-align: center;
  }

  #fotoEgresado,
  #fotoFallback {
    margin-right: 0;
    margin-bottom: 20px;
  }

  #nombreEgresado {
    font-size: 20px;
  }

  #datosEgresado {
    padding: 20px;
  }

  #infoAdicional {
    padding: 20px;
  }

  .cert-año {
    position: static;
    margin-top: 10px;
  }

  .info-item {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .info-item i {
    margin-bottom: 5px;
  }
}

@media (max-width: 576px) {
  #captchaCode {
    font-size: 20px;
    letter-spacing: 2px;
  }

  #captchaDisplay {
    padding: 10px 15px;
  }

  #headerResultado {
    padding: 15px 20px;
    font-size: 14px;
  }

  #nombreEgresado {
    font-size: 18px;
  }

  .cert-titulo {
    font-size: 16px;
  }
}

/* Animación suave para validación CAPTCHA - CASI IMPERCEPTIBLE */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== SECTION TITLE ENHANCEMENT ========== */
#buscarEgresadoSection .section-title h1,
#buscarEgresadoSection .section-title h2 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  color: var(--dark);
}

#buscarEgresadoSection .section-title h2 {
  font-size: 2.5rem;
}

/* ========== SEARCH FORM ENHANCEMENTS ========== */
#buscarEgresadoSection .border-inner {
  border-radius: 15px;
}

/* ========== FORMULARIO MÁS ANCHO HORIZONTALMENTE ========== */

/* Pantallas grandes - Formulario MÁS ANCHO */
@media (min-width: 1200px) {
  #buscarEgresadoSection .container {
    max-width: 1200px;
    /* Más ancho que antes */
  }

  #buscarEgresadoSection .col-lg-8.col-xl-6 {
    flex: 0 0 auto;
    width: 80%;
    /* MÁS ANCHO: era 75%, ahora 80% */
    max-width: 1000px;
    /* Límite máximo para que no se vea ridículo */
  }

  #formularioBusqueda {
    padding: 2.5rem 4rem !important;
    /* Más padding horizontal */
  }
}

@media (min-width: 1400px) {
  #buscarEgresadoSection .col-lg-8.col-xl-6 {
    width: 75%;
    /* En pantallas XL, un poco menos ancho pero aún grande */
  }
}

/* Layout horizontal para campos en pantallas grandes */
@media (min-width: 992px) {
  #formularioBusqueda {
    padding: 2.5rem 3rem !important;
  }

  /* DNI y NOMBRES en la misma fila con más espacio */
  #camposHorizontales {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    /* Más gap entre columnas */
    margin-bottom: 1.5rem;
  }

  /* CAPTCHA ocupa toda la fila */
  #captchaContainer {
    grid-column: 1 / -1;
  }
}

/* Mobile - Layout vertical (sin cambios) */
@media (max-width: 991px) {
  #camposHorizontales {
    display: block;
  }

  #camposHorizontales .campo-grupo {
    margin-bottom: 1rem;
  }
}

#btnLimpiar {
  color: #444 !important;
  background: #fff !important;
  border: 1.5px solid #d3d3d3 !important;
  font-weight: 600;
  transition: background 0.13s, color 0.13s, border 0.13s;
}

#btnLimpiar:hover,
#btnLimpiar:focus {
  background: #f4f4f4 !important;
  color: #232323 !important;
  border-color: #bbb !important;
}

.form-control.instant-valid {
  border-color: #28a745 !important;
  background-image: url("data:image/svg+xml,%3Csvg width='1em' height='1em' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3-3a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z' fill='%2328a745'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(1em + 0.375rem) calc(1em + 0.375rem);
  transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s, background-image 0.8s;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.13);
  opacity: 0;
  animation: fadeInCheck 0.6s forwards;
}

@keyframes fadeInCheck {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}