:root {
    --input-font-size: 1rem;

    --input-border-radius: 8px;
    --input-background-color: white;
    --input-border-size: 1px;
    --input-border-style: solid;
    --input-border-color: var(--base-stroke);

    --input-padding-x: 16px;
    --input-padding-y: 10px;

    --input-focused-border-color: var(--primary-500);

    --input-disabled-background-color: var(--primary-50);
    --input-disabled-border-color: var(--base-stroke);
}

.form-control,
.custom-file-label {
    font-size: var(--input-font-size);
    padding: var(--input-padding-y) var(--input-padding-x);

    border: var(--input-border-size) var(--input-border-style) var(--input-border-color);
    background-color: var(--input-background-color) !important;
    border-radius: var(--input-border-radius);
}

.form-control:focus,
.custom-file:has(.custom-file-input:focus) .custom-file-label {
    border-color: var(--input-focused-border-color) !important;
}

.form-control:disabled,
.custom-file:has(.custom-file-input:disabled) .custom-file-label {
    background-color: var(--input-disabled-background-color);
    border-color: var(--input-disabled-border-color);
}

/* #region MARK: Switch */
.custom-switch {
    align-self: center;
}

.custom-control-label::before {
    border-color: var(--input-border-color);
}

.custom-control-input:focus:not(:checked)~.custom-control-label::before,
.custom-control-input:focus:checked~.custom-control-label::before {
    border-color: var(--input-focused-border-color);
}

.custom-switch .custom-control-label::after {
    background-color: var(--input-border-color);
}

.custom-control-input:checked~.custom-control-label::before {
    border-color: var(--input-border-color);
    background-color: var(--primary-200);
}

.custom-switch .custom-control-input:checked~.custom-control-label::after {
    background-color: var(--primary-500);
}

/* #endregion Switch */

/* #region MARK: Input groups */
.input-group-text {
    background-color: var(--primary-100);
}

.has-length .input-group-text:not([class^="bg-"]):not([class*=" bg-"]) {
    background-color: var(--input-focused-border-color);
}

.has-length .input-group-text {
    border-color: var(--input-focused-border-color);
}

/* #endregion Input groups */

/* #region MARK: Custom button input group */
.form-control-icon-group {
    position: relative;
}

.form-control-icon-right {
    position: absolute;
    right: var(--input-padding-x);
    top: 50%;
    transform: translateY(-50%);
}

.form-control-icon-group:has(.form-control-icon-left) input {
    padding-left: calc(24px + var(--input-padding-x) + 8px);
}

.form-control-icon-left {
    position: absolute;
    left: var(--input-padding-x);
    top: 50%;
    transform: translateY(-50%);
}

/* #endregion MARK: Custom button input group */

/* #region MARK: Button toggle group */

.btn-group-toggle {
    --btn-toggle-group-col: 2;

    display: grid;
    gap: 8px;
    grid-template-columns: repeat(var(--btn-toggle-group-col), 1fr);
}

@media (min-width: 768px) {
    .btn-group-toggle {
        gap: 16px;
    }
}

.btn-group-toggle .btn .check {
    display: block;
    width: 24px;
    height: 24px;
}

.btn-group-toggle .btn.active .check {
    border: 6px solid var(--primary-500) !important;
}

.btn-group-toggle .btn.btn-primary .check {
    border: 1px solid var(--primary-500);
}

.btn-group-toggle .btn:has(input:disabled).btn-primary .check {
    border: 1px solid var(--primary-200);
}

.btn-group-toggle .btn:not(:has(input:disabled)):hover.btn-primary .check {
    border: 6px solid var(--primary-200);
}

.btn-group-toggle .btn:has(input:disabled).btn-primary {
    color: var(--primary-300) !important;
}

/* #endregion Button toggle group */

/* #region MARK: Custom checkbox */
.custom-checkbox {
    --checkbox-size: 24px;
}

.custom-checkbox label {
    cursor: pointer;

    display: flex;
    gap: 16px;
    align-items: center;
}

.custom-checkbox input[type="checkbox"] {
    display: none;
}

.custom-checkbox .checkbox {
    display: block;
    width: var(--checkbox-size);
    height: var(--checkbox-size);

    border-radius: 4px;

    border: var(--primary-100) 1px solid;
    background-color: white;
}

.custom-checkbox:has(input[type="checkbox"]:checked) .checkbox,
.custom-checkbox.checked .checkbox {
    background-color: var(--primary-500);
    border: none;

    background-image: url('/applidev/svg/Check.svg');
    background-repeat: no-repeat;
    background-position: center;
}

/* #endregion Custom checkbox */

/* #region MARK: Color radio */
.colour-radio-label {
    --colour-radio-label-size: 24px;
    --colour-radio-label-colour: rgb(64, 64, 218);
    margin-bottom: 0;

    width: var(--colour-radio-label-size);
    height: var(--colour-radio-label-size);
    border-radius: 50%;
    position: relative;
}

.colour-radio-label:has(input[type="radio"]:checked) {
    padding: 10px;
    border: 2px var(--primary-200) solid;
    background-color: var(--primary-400);
}

.colour-radio-label:has(input[type="radio"]:checked)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 50%;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.colour-radio-label::after {
    content: '';
    display: block;
    border-radius: 50%;
    height: 100%;
    width: 100%;
    border: 2px var(--primary-200) solid;
}

.colour-radio-label:has(input[type="radio"]:checked)::after {
    border: none;
}

.colour-radio-label input[type="radio"] {
    display: none;
}

/* #endregion Color radio */