* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: consolas;
    border: none;
    outline: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #031321;
}

button {
    background-color: inherit;
    position: relative;
    display: inline-block;
    padding: 15px 30px;
    color: #2196f3;
    text-transform: uppercase;
    font-size: 24px;
    letter-spacing: 4px;
    overflow: hidden;
    transition: 0.3s;
}

button:hover {
    color: #ff7300;
    background-color: #2196f3;
    box-shadow:
        0 0 10px #2196f3,
        0 0 40px #2196f3,
        0 0 80px #2196f3;


}

button:hover span {
    animation: none;
}

button span {
    position: absolute;
    display: block;
    animation: animate 1s linear infinite;
}

button span:nth-child(1) {
    top: 0;
    left: -100%;
    /* left: 0%; */
    width: 100%;
    height: 2px;
    background: linear-gradient(var(--angle), transparent, #2196f3);
}

button span:nth-child(2) {
    left: calc(100% - 2px);
    top: -100%;
    /* top: 0%; */
    width: 2px;
    height: 100%;
    background: linear-gradient(var(--angle), transparent, #ff7300);
    animation-delay: 0.5s;
}

button span:nth-child(3) {
    top: calc(100% - 2px);
    left: 100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(var(--angle), transparent, #2196f3);
}

button span:nth-child(4) {
    left: 0;
    top: 100%;
    /* top: 0%; */
    width: 2px;
    height: 100%;
    background: linear-gradient(var(--angle), transparent, #ff7300);
    animation-delay: 0.5s;
}

@keyframes animate {
    50% {
        background: linear-gradient(var(--angle), transparent, var(--color1));
    }

    100% {
        background: linear-gradient(var(--angle), transparent, var(--color2));
        left: var(--left);
        top: var(--top);
    }
}