<div class="g-container">
    <div class="g-username">
        <input type="text" placeholder="user name" class="g_input" >
    </div>
    <div class="g-username">
        <input type="text" placeholder="code" class="g_input" >
    </div>
</div>


* {
  font-family: "Work Sans", sans-serif;
  box-sizing: border-box;
}

html,
body {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.g-container {
    padding: 10px;
    border: 1px solid #eee;
    transition: all .3s;
}

.g-username {
    padding :15px;
    transition: 0.3s;
}

.g_input {
    border: none;
    outline: none;
    width: 20vw;
    padding: 15px;
    font-size: 18px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    overflow: hidden;
    transition: 0.3s;
    
    &:focus {
        border-color: hsl(199, 98%, 48%);
    }
}

p {
    display: none;
    text-indent: 0px;
    color: red;
    padding: 10px 0;
}

.g-container:focus-within {
    transform: translateY(-4px);
    // background: hsla(199, 98%, 48%, .2);
    box-shadow: 0 0 10px #ddd;
    border-color: hsl(199, 98%, 48%);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.