body {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.87);
}


.switch {
    position: relative;
}


label {
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    width: 80px;
    height: 32px;
    border-radius: 16px;
    cursor: pointer;
    overflow: hidden;
}

label::before {
    content: "";
    background-color: white;
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    order: 2;
    flex-shrink: 0;
}

label,
label::before,
span {
    transition: all 300ms ease-in-out;
}


span {
    display: inline-block;
    width: calc(80px - 24px - 4px);
    flex-shrink: 0;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.no {
    order: 1;
}

.yes {
    color: white;
    order: 3;
}


[type="checkbox"]:checked + label {
    background-color: #2196f3;
}

[type="checkbox"]:checked + label::before {
    transform: translateX(-48px);
}

[type="checkbox"]:checked + label span {
    transform: translateX(-100%);
}
