* {
    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: block;
    width: 3.2rem;
    height: 1.4rem;
    background-color: #ccc;
    border-radius: 0.8rem;
    position: relative;
    cursor: pointer;
}

.toggle-wrap:before {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    width: 1.6rem;
    height: 1.6rem;
    z-index: 1;
    background-color: #999;
    transition: all 400ms ease-in;
    border-radius: 50%;
}

.toggle-wrap.checked:before {
    left: calc(3.2rem - 1.6rem);
    background-color: #000;
}

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