/*
 * Exact replica of the React UI Checkbox component
 * (Jarvis_IdentityManagement_Frontend/src/components/ui/Checkbox + _checkbox.css)
 * for server-rendered Identity pages. The checked fill follows the page's
 * --primary-color token, mirroring the component's theme-color fill.
 *
 * Markup contract (same shape the React component renders):
 *   <label class="jarvis-checkbox-label">
 *     <input type="checkbox" class="jarvis-checkbox" />
 *     <span>Label text</span>
 *   </label>
 */

.jarvis-checkbox {
    height: 1.25rem;                     /* h-5 */
    width: 1.25rem;                      /* w-5 */
    border: 1px solid #d1d5db;           /* border border-gray-300 */
    border-radius: 0.25rem;              /* rounded */
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background-color: #ffffff;
    color: var(--primary-color, #10b981);
    transition: background-color 150ms ease-in-out, border-color 150ms ease-in-out; /* transition-colors duration-150 */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
}

.jarvis-checkbox:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: currentColor;      /* bg-current */
    border-color: transparent;
}

.jarvis-checkbox:disabled {
    color: #e5e7eb;                      /* text-gray-200 */
    background-color: #f3f4f6;           /* bg-gray-100 */
    cursor: not-allowed;
}

.jarvis-checkbox-label {
    display: inline-flex;                /* inline-flex */
    align-items: center;
    cursor: pointer;
}

.jarvis-checkbox-label > span {
    margin-inline-start: 0.5rem;         /* ltr:ml-2 rtl:mr-2 */
}

/* rtl.css globally forces margin-left 0.5rem on native checkboxes; the label span already
   provides the component's 0.5rem gap, so neutralize it to avoid double spacing in RTL.
   (input.jarvis-checkbox[type="checkbox"] out-specifies rtl.css's input[type="checkbox"].) */
html[dir="rtl"] input.jarvis-checkbox[type="checkbox"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.jarvis-checkbox-label:has(.jarvis-checkbox:disabled) {
    cursor: not-allowed;
}

.jarvis-checkbox-label:has(.jarvis-checkbox:disabled) > span {
    opacity: 0.5;
}
