﻿:root {
    --duration: .4s;
}

.checker {
    display: block;
    font-size: 40vmin;
    height: 2rem;
    width: 3.5rem;
    box-sizing: content-box;
    padding: 0.15rem;
    border-radius: 0.45rem;
    transition: transform var(--duration) ease;
    cursor: pointer;
}

.checkmark {
    width: 2rem;
    height: 2rem;
    transition: transform var(--duration) ease;
    transform: translateX(-0.4rem);
    z-index: 5;
}

    .checkmark svg {
        display: block;
        background: #e5e5e5;
        transform: translateX(0.4rem);
        border-radius: .45rem;
        transition: background-color var(--duration) ease, transform calc(var(--duration) * 1.5) ease;
    }

        .checkmark svg path {
            stroke-dasharray: 90 90;
            stroke-dashoffset: 90;
            transition: stroke-dashoffset calc(var(--duration) / 3) linear calc(var(--duration) / 3);
        }

.checkbox {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.4;
    visibility: hidden;
}

    .checkbox:checked ~ .checkmark {
        transform: translate(1.9rem);
    }

        .checkbox:checked ~ .checkmark svg {
            background: #0099A9;
            transform: translate(-0.4rem);
        }

            .checkbox:checked ~ .checkmark svg path {
                stroke-dashoffset: 0;
            }

.check-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: white;
    z-index: 2;
}

    .check-bg:before, .check-bg:after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 100%;
        border-radius: inherit;
    }

    .check-bg:after {
        background: white;
    }

    .check-bg:before {
        transition: transform var(--duration) ease;
        transform: translateY(0%);
        transform-origin: center center;
        background: #0099A9;
        filter: blur(0.15rem);
        opacity: 0.2;
        z-index: -1;
    }

.checker.checker:active {
    transform: scale(0.85);
    transition-duration: calc(var(--duration) / 2);
}

    .checker.checker:active .check-bg::before {
        transform: translateY(0) scale(0.8);
        opacity: 0.2;
    }

*,
*::before,
*::after {
    box-sizing: border-box;
    position: relative;
}
