*,
*::before,
*::after 
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body
{
    height: 60vh;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-direction: column;
    font-family: sans-serif;
}

.form
{
    width: 50%;
    position: relative;
    height: 50px;
    overflow: hidden;
}

.form input
{
    width: 100%;
    height: 100%;
    color: #595f6e;
    padding-top: 20px;
    border: none;
    outline: none;
}

.form label
{
    position: absolute;
    bottom: 0px;
    left: 0%;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-bottom: 1px solid black ;
}

.form label::after
{
    content: "";
    position: absolute;
    left: 0px;
    bottom: -1px;
    height: 100%;
    width: 100%;
    border-bottom: 3px solid #5fa8d3;
    transform: translateX(-100%);
    transition: transform all 0.3s ease;
}

.content-name
{
    position: absolute;
    bottom: 5px;
    left: 0px;
    transition: all 0.3s ease;
}

.form input:focus + .label-name .content-name, 
.form input:valid + .label-name .content-name
{
    transform: translateY(-150%);
    font-size: 14px;
    color: #5fa8d3;
}

.form input:focus + .label-name::after, 
.form input:valid + .label-name::after
{
    transform: translateX(0%);
}
