:root {
    --box-height: 50px; /* Height of the custom checkbox */
    --box-width: 50px;  /* Width of the custom checkbox */
    --main-color: #5128c6;  /* Color of the custom checkbox */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f5f5f5;
}

/* Hide the native checkbox */
.checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Style the label to act as the checkbox UI */
.checkbox-container label {
    width: var(--box-width);
    height: var(--box-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #c2c2c2;
    border-radius: 4px;
    background-color: white;
    position: relative;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

/* Make the inner checkmark image responsive and centered */
.checkbox-container label img {
    width: 90%;               /* Make the image fill 60% of the box */
    height: 90%;              /* Keep square aspect ratio */
    object-fit: contain;      /* Avoid image distortion */
    pointer-events: none;     /* Allow label to capture the click */
}

/* Hover effect */
.checkbox-container label:hover {
    border-color: var(--main-color);
}

/* Checked styles */
.checkbox:checked + label {
    border-color: #CFBFFF;
    background-color: var(--main-color);
}

/* Focus or active states */
.checkbox:focus + label,
label:active {
    outline: 2px solid #CFBFFF;
}
