.input {
    margin-bottom: 15px;
    position: relative;
    display: inline-flex;
    flex-direction: column;
    input {
        position: absolute;
        opacity: 0;
        width: 1px;
        height: 1px;
        margin: 0;
        &:checked ~ label .toggler {
            background-color: $secondary_color;
            &::after {
                transform: translateX(var(--toggle-shift));
            }
        }
        &:focus-visible ~ label .toggler {
            box-shadow: 0 0 0 3px rgba($secondary_color, 0.3);
        }
        &:disabled ~ label {
            cursor: not-allowed;
            .toggler {
                opacity: 0.5;
                cursor: not-allowed;
            }
            .label {
                color: rgba(#000000, 0.4);
            }
        }
    }
    label {
        display: inline-flex;
        gap: 12px;
        align-items: center;
        cursor: pointer;
    }
    .toggler {
        --toggle-shift: 22px;
        position: relative;
        flex: 0 0 auto;
        width: 46px;
        height: 26px;
        border-radius: 999px;
        background-color: #dcdfe6;
        transition: background-color 0.2s ease, box-shadow 0.2s ease;
        &::after {
            content: "";
            position: absolute;
            top: 3px;
            left: 3px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: $white_color;
            box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
            transition: transform 0.2s ease;
        }
    }
    .label {
        font-size: 15px;
        line-height: 1.3;
        color: $primary_color;
    }
    &.small {
        .toggler {
            --toggle-shift: 16px;
            width: 38px;
            height: 22px;
            &::after {
                width: 16px;
                height: 16px;
            }
        }
        .label {
            font-size: 14px;
        }
    }
    p.error {
        margin: 4px 0 0;
        font-size: 12px;
        line-height: 1.3;
        color: #b32d2e;
    }
}
