* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.toggle-wrap {
    display: inline-block;
    width: 3.2rem;
    height: 1.7rem;
    background-color: #eee;
    border-radius: 5px;
    position: relative;
    cursor: pointer;
}

.toggle-wrap:before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    z-index: 1;
    background-color: #d41d6d;
    transition: all 400ms ease-in;
    transform: translateX(0);
    border-radius: 5px;
    opacity: 0.4;
}

.toggle-wrap.checked:before {
    transform: translateX(100%);
    opacity: 1;
}

.toggle-wrap .toggle {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}