Preheat oven to 350°F (175°C). Line a muffin tin with cupcake liners.
In a bowl, whisk together flour, baking powder, and salt. Set aside.
In a large bowl, cream butter and sugar until light and fluffy.
Beat in eggs one at a time, then add vanilla extract, lime juice, lime zest, and tequila.
Alternate adding dry ingredients and buttermilk to the wet mixture, beginning and ending with dry ingredients. Mix until just combined.
Divide batter evenly among cupcake liners (about 2/3 full).
Bake 16-18 minutes or until a toothpick inserted comes out clean. Cool completely on a wire rack.
For frosting, beat cream cheese and butter until smooth. Gradually add powdered sugar, then lime juice, tequila, and salt. Mix until creamy.
Frost cooled cupcakes. Dip or sprinkle edges with kosher salt or colored sugar to mimic a margarita rim. Garnish with lime slices if desired.
Serve and enjoy responsibly!