.checkbox-input {
    /* Code to hide the input */
    clip: rect(0 0 0 0);
    clip-path: inset(100%);

    &:checked+.checkbox-tile {
        border-color: var(--secondary_color);
        box-shadow: 0 5px 10px rgba(#000, 0.1);
        color: var(--secondary_color);

        &:before {
            transform: scale(1);
            opacity: 1;
            background-color: var(--secondary_color);
            border-color: var(--secondary_color);
        }

        .checkbox-icon,
        .checkbox-label {
            color: var(--secondary_color);
        }
    }



    &:checked+.checkbox-tile-success {
        border-color: var(--success);
        box-shadow: 0 5px 10px rgba(#000, 0.1);
        color: var(--success);

        &:before {
            transform: scale(1);
            opacity: 1;
            background-color: var(--success);
            border-color: var(--success);
        }

        .checkbox-icon,
        .checkbox-label {
            color: var(--success);
        }
    }

    &:checked+.checkbox-tile-selected {
        border-color: var(--primary_color);
        box-shadow: 0 5px 10px rgba(#000, 0.1);
        color: var(--primary_color);

        &:before {
            transform: scale(1);
            opacity: 1;
            background-color: var(--primary_color);
            border-color: var(--primary_color);
        }

        .checkbox-icon,
        .checkbox-label {
            color: var(--primary_color);
        }
    }

    &.is-invalid+.checkbox-tile {
        border-color: var(--error);
        box-shadow: 0 5px 10px rgba(#000, 0.1);
        color: var(--error);

        .checkbox-icon,
        .checkbox-label {
            color: var(--error);
        }
    }

    /* &:focus+.checkbox-tile {
        border-color: var(--secondary_color);
        box-shadow: 0 5px 10px rgba(#000, 0.1), 0 0 0 4px #b5c9fc;

        &:before {
            transform: scale(1);
            opacity: 1;
        }
    } */
}

.checkbox-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid #b5bfd9;
    background-color: #fff;
    box-shadow: 0 5px 10px rgba(#000, 0.1);
    transition: 0.15s ease;
    cursor: pointer;
    position: relative;

    /*Immagine di spunta*/
    &:before {
        content: "";
        position: absolute;
        display: block;
        width: 1.25rem;
        height: 1.25rem;
        border: 2px solid #b5bfd9;
        background-color: #fff;
        border-radius: 50%;
        top: 0.25rem;
        left: 0.25rem;
        opacity: 0;
        transform: scale(0);
        transition: 0.25s ease;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192' fill='%23FFFFFF' viewBox='0 0 256 256'%3E%3Crect width='256' height='256' fill='none'%3E%3C/rect%3E%3Cpolyline points='216 72.005 104 184 48 128.005' fill='none' stroke='%23FFFFFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='32'%3E%3C/polyline%3E%3C/svg%3E");
        background-size: 12px;
        background-repeat: no-repeat;
        background-position: 50% 50%;
    }

    &:hover {
        border-color: var(--secondary_color);

        &:before {
            transform: scale(1);
            opacity: 1;
        }
    }
}



.checkbox-tile-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 10rem;
    min-height: 10rem;
    border-radius: 0.5rem;
    border: 2px solid var(--success);
    background-color: #2ca33236;
    box-shadow: 0 5px 10px rgba(#000, 0.1);
    transition: 0.15s ease;
    cursor: pointer;
    position: relative;

    &:before {
        content: "";
        position: absolute;
        display: block;
        width: 1.25rem;
        height: 1.25rem;
        border: 2px solid var(--success);
        background-color: #2ca33236;
        border-radius: 50%;
        top: 0.25rem;
        left: 0.25rem;
        opacity: 0;
        transform: scale(0);
        transition: 0.25s ease;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192' fill='%23FFFFFF' viewBox='0 0 256 256'%3E%3Crect width='256' height='256' fill='none'%3E%3C/rect%3E%3Cpolyline points='216 72.005 104 184 48 128.005' fill='none' stroke='%23FFFFFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='32'%3E%3C/polyline%3E%3C/svg%3E");
        background-size: 12px;
        background-repeat: no-repeat;
        background-position: 50% 50%;
    }
}

.checkbox-tile-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 10rem;
    min-height: 10rem;
    border-radius: 0.5rem;
    border: 2px solid var(--primary_color);
    background-color: #a33e0f36;
    box-shadow: 0 5px 10px rgba(#000, 0.1);
    transition: 0.15s ease;
    cursor: pointer;
    position: relative;

    &:before {
        content: "";
        position: absolute;
        display: block;
        width: 1.25rem;
        height: 1.25rem;
        border: 2px solid var(--primary_color);
        background-color: #a33e0f36;
        border-radius: 50%;
        top: 0.25rem;
        left: 0.25rem;
        opacity: 0;
        transform: scale(0);
        transition: 0.25s ease;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192' fill='%23FFFFFF' viewBox='0 0 256 256'%3E%3Crect width='256' height='256' fill='none'%3E%3C/rect%3E%3Cpolyline points='216 72.005 104 184 48 128.005' fill='none' stroke='%23FFFFFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='32'%3E%3C/polyline%3E%3C/svg%3E");
        background-size: 12px;
        background-repeat: no-repeat;
        background-position: 50% 50%;
    }
}

.checkbox-icon {
    transition: .375s ease;
    color: var(--secondary_color);

    svg {
        width: 3rem;
        height: 3rem;
    }
}

.checkbox-label {
    color: var(--secondary_color);
    transition: .375s ease;
    text-align: center;
}

.checkbox-description , .checkbox-cost {
    color: var(--secondary_color);
    transition: .375s ease;
    text-align: center;
    margin: 0rem 1rem 0rem 1rem;
    font-size: smaller;
}
