.z-checkbox {
    appearance: none;
    border: none;
    background-color: unset;
    font-size: 1rem;
    font-family: inherit;

    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.3em 1em;
    padding-right: 1.75em;
    overflow: hidden;
    transition: padding-left 0.25s;
}

.z-checkbox.checkbox {
    .z-checkbox-area {
        .z-checkbox-bg {
            border-radius: 2px;
        }
    }
}

.z-checkbox.radio {
    .z-checkbox-area {
        .z-checkbox-bg {
            border-radius: 10px;
        }
        .z-checkbox-spot {
            position: absolute;
            top: 50%;
            bottom: 50%;
            left: 50%;
            right: 50%;
            transition: top 0.25s, bottom 0.25s, left 0.25s, right 0.25s;
        }
        .z-checkbox-spot::after {
            content: '';
            display: block;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background-color: var(--mdc-theme-primary);
        }
    }
}

.z-checkbox:hover {
    background-color: rgb(235, 235, 235);
}

.z-checkbox-area {
    position: relative;
    isolation: isolate;

    width: 20px;
    height: 20px;

    flex-shrink: 0;

    margin-left: 1em;

    svg, .z-checkbox-bg, .z-checkbox-cover {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        cursor: pointer;
    }

    svg {
        z-index: 10;
        pointer-events: none;

        path {
            stroke-width: 4;
        }
    }

    .z-checkbox-bg {
        overflow: hidden;
        border: 2px solid #757575;
    }

    .z-checkbox-cover {
        border-radius: 2px;
        overflow: hidden;
        z-index: 20;
        pointer-events: none;
        transition: left 0.25s ease-in-out;
        background-color: transparent;
    }
}

.z-checkbox-area:hover::after {
    content: '';
    position: absolute;
    top: -0.5em;
    bottom: -0.5em;
    left: -0.5em;
    right: -0.5em;
    background-color: #c0c0c0;
    border-radius: calc(0.5em + 10px);
    z-index: -1;

}

.z-list .z-checkbox[data-state="checked"] {
    padding-left: 2em;
}

.z-checkbox.checkbox:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.z-checkbox.checkbox[data-state="checked"]:disabled {
    .z-checkbox-bg {
        background-color: #bdbdbd;
        border-color: #bdbdbd;
    }

    .z-checkbox-area:hover::after {
        content: '';
        background-color: transparent;
    }
}

.z-checkbox.checkbox[data-state="checked"] {

    .z-checkbox-cover {
        left: 100%;
        background-color: var(--mdc-theme-primary);
    }

    .z-checkbox-bg {
        background-color: var(--mdc-theme-primary);
        border-color: var(--mdc-theme-primary);
    }
}

.z-checkbox.radio[data-state="checked"] {
    .z-checkbox-bg {
        border-color: var(--mdc-theme-primary);
    }
    .z-checkbox-spot {
        top: 25%;
        bottom: 25%;
        left: 25%;
        right: 25%;
    }
}

.z-list-group > .z-checkbox {
    width: 100%;
}

.horizontal-list .z-list-group{
    display: inline-flex;
    flex-direction: row;
}

.horizontal-list .z-list{
    display: inline;

}

.horizontal-list .z-checkbox-area{
    margin-left: 1em; 
}

.horizontal-list{
    text-align: right;
    
}
