/* static/css/custom_forms.css */

.custom-checkbox-label input[type="checkbox"],
.custom-checkbox-label input[type="radio"] {
    display: none; /* Hide the default checkbox */
}

.custom-checkbox-label span {
    position: relative;
    padding-left: 28px; /* Space for the custom checkbox */
    cursor: pointer;
    display: inline-block;
    line-height: 20px;
}

.custom-checkbox-label span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db; /* gray-300 */
    border-radius: 4px;
    background-color: white;
    transition: background-color 0.2s, border-color 0.2s;
}

.custom-checkbox-label input[type="checkbox"]:checked + span::before {
    background-color: #2563eb; /* blue-600 */
    border-color: #2563eb; /* blue-600 */
}

.custom-checkbox-label input[type="checkbox"]:checked + span::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Radio button specific styles */
.custom-checkbox-label input[type="radio"] + span::before {
    border-radius: 50%;
}

.custom-checkbox-label input[type="radio"]:checked + span::before {
    background-color: #2563eb; /* blue-600 */
    border-color: #2563eb; /* blue-600 */
}

.custom-checkbox-label input[type="radio"]:checked + span::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
}
