body {
    background: #2e394d;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: 'Rubik', sans-serif;
}

* {
    box-sizing: border-box;
}

*:before,
*:after {
    content: "";
    position: absolute;
}

input {
    height: 40px;
    left: 0;
    opacity: 0;
    position: absolute;
    top: 0;
    width: 40px;
}

.container {
    text-align: center;
    padding: 20px;
}

.title {
    font-size: 2em;
    color: #ffffff;
    margin-bottom: 30px;
    font-weight: 500;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(-45px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.toggle-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    background: #dec387;
    margin: 0 auto;
    width: 220px;
}

.toggle {
    position: relative;
    display: inline-block;
}

label.toggle-item {
    width: 7em;
    background: #2e394d;
    height: 3em;
    display: inline-block;
    border-radius: 50px;
    margin: 40px;
    position: relative;
    transition: all 0.3s ease;
    transform-origin: 20% center;
    cursor: pointer;
}

label.toggle-item:before {
    display: block;
    transition: all 0.2s ease;
    width: 2.3em;
    height: 2.3em;
    top: 0.25em;
    left: 0.25em;
    border-radius: 2em;
    border: 2px solid #88cf8f;
    transition: 0.3s ease;
}

.normal label {
    background: #af4c4c;
    border: 0.5px solid rgba(117, 117, 117, 0.31);
    box-shadow: inset 0px 0px 4px 0px rgba(0, 0, 0, 0.2), 0 -3px 4px rgba(0, 0, 0, 0.15);
}

.normal label:before {
    border: none;
    width: 2.5em;
    height: 2.5em;
    box-shadow: inset 0.5px -1px 1px rgba(0, 0, 0, 0.35);
    background: #ffffff;
    transform: rotate(-25deg);
}

.normal label:after {
    background: transparent;
    height: calc(100% + 8px);
    border-radius: 30px;
    top: -5px;
    width: calc(100% + 8px);
    left: -4px;
    z-index: 0;
    box-shadow: inset 0px 2px 4px -2px rgba(0, 0, 0, 0.2), 0px 1px 2px 0px rgba(151, 151, 151, 0.2);
}

#normal:checked+label {
    background: #4caf50;
}

#normal:checked+label:before {
    left: 67px;
}

@media (max-width: 960px) {
    .toggle-wrapper {
        flex: 1 1 calc(100% / 2);
    }

    .title {
        font-size: 2em;
    }
}

@media (max-width: 700px) {
    .toggle-wrapper {
        flex: 1 1 100%;
    }

    .title {
        font-size: 1.5em;
    }
}