/* Shared custom checkbox used by app-owned grid templates. */
.portal-checkbox {
    min-height: 20px;
    padding-left: 20px;
}

.portal-checkbox > label {
    display: inline-block;
    position: relative;
    padding-left: 5px;
    cursor: pointer;
}

.portal-checkbox > label::before,
.portal-checkbox > label::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    margin-left: -18px;
    box-sizing: border-box;
}

.portal-checkbox > label::before {
    content: "";
    display: inline-block;
    border: 1px solid #cccccc;
    border-radius: 3px;
    background-color: #ffffff;
    transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
}

.portal-checkbox > label::after {
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    padding: 0;
    color: #ffffff;
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
}

.portal-checkbox > input[type="checkbox"] {
    opacity: 0;
}

.portal-checkbox > input[type="checkbox"]:focus + label::before {
    outline: 3px solid var(--brand-focus-indicator, #00341A);
    outline-offset: 2px;
}

.portal-checkbox > input[type="checkbox"]:checked + label::after {
    content: "\f00c";
    font-family: "FontAwesome";
}

.portal-checkbox > input[type="checkbox"]:disabled + label {
    opacity: 0.65;
}

.portal-checkbox > input[type="checkbox"]:disabled + label::before {
    background-color: #eeeeee;
    cursor: not-allowed;
}

.portal-checkbox--success-green > input[type="checkbox"]:checked + label::before {
    background-color: var(--brand-fibre-green, #7DC341);
    border-color: var(--brand-fibre-green, #7DC341);
}

.portal-checkbox--success-primary > input[type="checkbox"]:checked + label::before {
    background-color: var(--brand-action-primary, #00341A);
    border-color: var(--brand-action-primary, #00341A);
}

.k-grid td.portal-checkbox-cell,
.k-grid .k-grid-header th.portal-checkbox-cell {
    text-align: center;
    vertical-align: middle;
    padding: 10px 4px;
}

.portal-checkbox.portal-checkbox--grid {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0 auto;
    padding: 0;
}

.portal-checkbox--grid > input[type="checkbox"],
.portal-checkbox--grid > label {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.portal-checkbox--grid > label::before,
.portal-checkbox--grid > label::after {
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}
